cherry-pick(#12004): chore: revert "fix(test-runner): escape backslashes in win cli"
This commit is contained in:
parent
786bb337f0
commit
35f921e7aa
|
|
@ -181,7 +181,7 @@ function forceRegExp(pattern: string): RegExp {
|
||||||
const match = pattern.match(/^\/(.*)\/([gi]*)$/);
|
const match = pattern.match(/^\/(.*)\/([gi]*)$/);
|
||||||
if (match)
|
if (match)
|
||||||
return new RegExp(match[1], match[2]);
|
return new RegExp(match[1], match[2]);
|
||||||
return new RegExp(pattern.replace(/\\/g, '\\\\'), 'gi');
|
return new RegExp(pattern, 'gi');
|
||||||
}
|
}
|
||||||
|
|
||||||
function overridesFromOptions(options: { [key: string]: any }): Config {
|
function overridesFromOptions(options: { [key: string]: any }): Config {
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { test, expect } from './playwright-test-fixtures';
|
import { test, expect } from './playwright-test-fixtures';
|
||||||
import path from 'path';
|
|
||||||
|
|
||||||
test('should filter by file name', async ({ runInlineTest }) => {
|
test('should filter by file name', async ({ runInlineTest }) => {
|
||||||
const result = await runInlineTest({
|
const result = await runInlineTest({
|
||||||
|
|
@ -94,14 +93,6 @@ test('should run nothing for missing line', async ({ runInlineTest }) => {
|
||||||
expect(result.failed).toBe(1);
|
expect(result.failed).toBe(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should escape path on windows', async ({ runInlineTest }) => {
|
|
||||||
const result = await runInlineTest({
|
|
||||||
'foo/test.spec.ts': `pwt.test('fails', () => { expect(1).toBe(2); });`,
|
|
||||||
}, undefined, undefined, { additionalArgs: [path.join('foo', 'test.spec.ts')] });
|
|
||||||
expect(result.exitCode).toBe(1);
|
|
||||||
expect(result.failed).toBe(1);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('should focus a single nested test spec', async ({ runInlineTest }) => {
|
test('should focus a single nested test spec', async ({ runInlineTest }) => {
|
||||||
const result = await runInlineTest({
|
const result = await runInlineTest({
|
||||||
'foo.test.ts': `
|
'foo.test.ts': `
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,7 @@ test('should match cli string argument', async ({ runInlineTest }) => {
|
||||||
const { test } = pwt;
|
const { test } = pwt;
|
||||||
test('pass', ({}) => {});
|
test('pass', ({}) => {});
|
||||||
`
|
`
|
||||||
}, {}, {}, { additionalArgs: [`dir${path.sep}a`] });
|
}, {}, {}, { additionalArgs: [`dir\\${path.sep}a`] });
|
||||||
expect(result.passed).toBe(1);
|
expect(result.passed).toBe(1);
|
||||||
expect(result.report.suites.map(s => s.file).sort()).toEqual(['a.test.ts']);
|
expect(result.report.suites.map(s => s.file).sort()).toEqual(['a.test.ts']);
|
||||||
expect(result.exitCode).toBe(0);
|
expect(result.exitCode).toBe(0);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue