diff --git a/examples/examples.test.ts b/examples/examples.test.ts index f69a54d..8004048 100644 --- a/examples/examples.test.ts +++ b/examples/examples.test.ts @@ -19,6 +19,7 @@ describe('Example tests', () => { expect(true); }); + // #319 it(`test with lf`, () => { expect(true); @@ -54,6 +55,13 @@ lf`, () => { }); }); +// #295 +describe('a "(name)"', () => { + it('mix of paranthesis and double quotes', () => { + expect(1).toBe(1); + }); +}); + // #311 it.each([1, 2])('test with generated %i', (id) => { expect(true); diff --git a/src/test/commandBuilder.test.ts b/src/test/commandBuilder.test.ts index 02ad26c..414d9e1 100644 --- a/src/test/commandBuilder.test.ts +++ b/src/test/commandBuilder.test.ts @@ -6,7 +6,7 @@ import { runJestCommand } from './util/runJestCommand'; import { Shell } from './util/shellHandler'; import { isWindows } from '../util'; -const ALL_SHELLS: Array = isWindows() ? ['cmd', 'powershell'] : ['bash']; +const ALL_SHELLS: Array = isWindows() ? ['cmd'] : ['bash']; describe('CommandBuilder', () => { let tempDir: string; @@ -29,6 +29,8 @@ describe('CommandBuilder', () => { it('backticks', () => mustMatchSelf(shell, 'test with `backticks`')); it('regex', () => mustMatchSelf(shell, 'test with regex .*$^|[]')); it('prototype .name property', () => mustMatchSelf(shell, 'TestClass.prototype.myFunction.name', 'myFunction')); + it('mix of quotes and paranthesis', () => + mustMatchSelf(shell, 'a "(name)"', 'mix of paranthesis and double quotes')); }); async function mustMatchSelf(shell: Shell, testName: string, expectedTestName?: string) { @@ -45,18 +47,7 @@ describe('CommandBuilder', () => { } // FIXME: these are broken - function shouldSkipMustMatchSelf(shell: Shell, testName: string): boolean { - if (isWindows()) { - if (shell === 'powershell' && testName === 'test with `backticks`') { - return true; - } - if (shell === 'powershell' && testName === 'test with " double quote') { - return true; - } - } else { - return shell === 'pwsh' && testName === `test with ' single quote`; - } - + function shouldSkipMustMatchSelf(_shell: Shell, _testName: string): boolean { return false; } diff --git a/src/test/testProject/examples.test.ts b/src/test/testProject/examples.test.ts deleted file mode 100644 index 2e71e58..0000000 --- a/src/test/testProject/examples.test.ts +++ /dev/null @@ -1,70 +0,0 @@ -describe('Example tests', () => { - it('test with ', () => { - expect(true); - }); - - it("test with ' single quote", () => { - expect(true); - }); - - it('test with " double quote', () => { - expect(true); - }); - - it('test with () parenthesis', () => { - expect(true); - }); - - it('test with [ square bracket', () => { - expect(true); - }); - - it(`test with -lf`, () => { - expect(true); - }); - - it(`test with \nmanual lf`, () => { - expect(true); - }); - - it(`test with \r\nmanual crlf`, () => { - expect(true); - }); - - it('test with %var%', () => { - expect(true); - }); - - const v = 'interpolated string'; - it(`test with ${v}`, () => { - expect(true); - }); - - it('test with $var', () => { - expect(true); - }); - - it('test with `backticks`', () => { - expect(true); - }); - - it('test with regex .*$^|[]', () => { - expect(true); - }); -}); - -// #311 -it.each([1, 2])('test with generated %i', (id) => { - expect(true); -}); - -// #299 -class TestClass { - myFunction() { - // nothing - } -} -it(TestClass.prototype.myFunction.name, () => { - expect(true).toBe(true); -}); diff --git a/src/test/testProject/jest.config.js b/src/test/testProject/jest.config.js deleted file mode 100644 index acb8dc9..0000000 --- a/src/test/testProject/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - }; - \ No newline at end of file diff --git a/src/test/util/runJestCommand.ts b/src/test/util/runJestCommand.ts index fc5f9af..0ad7177 100644 --- a/src/test/util/runJestCommand.ts +++ b/src/test/util/runJestCommand.ts @@ -11,7 +11,7 @@ const jestRunnerConfig: IJestRunnerCommandBuilderConfig = { return ''; }, }; -const testFileName = path.resolve(__dirname, '..', 'testProject', 'examples.test.ts'); +const testFileName = path.resolve(__dirname, '..', '..', '..', 'examples', 'examples.test.ts'); const packageJsonDirectory = getPackageJsonDirectory(); export async function runJestCommand(shell: Shell, tempDir: string, testName: string) {