From 2116d6f2790d534512078d0089d4cbf3db3173f0 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sat, 5 Oct 2019 08:56:38 +0900 Subject: [PATCH 1/5] Added end-to-end tests back to CircleCI flow --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index cd83ede4b..8f9899ad9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -144,6 +144,9 @@ workflows: - prettier: requires: - build + - test-end-to-end: + requires: + - build - test-unit: requires: - build From e52a5d72e1994a8232fe79711f74240582973b26 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sat, 5 Oct 2019 08:59:29 +0900 Subject: [PATCH 2/5] Used npx instead of a Circle install --- .circleci/config.yml | 1 - test/createTests.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8f9899ad9..f02a3a80f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -91,7 +91,6 @@ jobs: - attach_workspace: at: "." - - run: npm i -g ts-node - run: npm run test:end-to-end test-unit: diff --git a/test/createTests.ts b/test/createTests.ts index 65e2df159..87ecf520c 100644 --- a/test/createTests.ts +++ b/test/createTests.ts @@ -36,7 +36,7 @@ export const createTests = ( const act = async (testArgs: string[]) => { try { - return await exec(`ts-node ${binFile} ${testArgs.join(" ")}`, { + return await exec(`npx ts-node ${binFile} ${testArgs.join(" ")}`, { cwd, }); } catch (error) { From e95022be1fc9de13bfc25d90eeb452bc7cd38a65 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sat, 5 Oct 2019 09:03:55 +0900 Subject: [PATCH 3/5] Make end-to-end depend on tsc step instead of ts-node --- .circleci/config.yml | 1 + test/createTests.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f02a3a80f..7fc6f2dfe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -146,6 +146,7 @@ workflows: - test-end-to-end: requires: - build + - tsc - test-unit: requires: - build diff --git a/test/createTests.ts b/test/createTests.ts index 87ecf520c..8fa598c31 100644 --- a/test/createTests.ts +++ b/test/createTests.ts @@ -36,7 +36,7 @@ export const createTests = ( const act = async (testArgs: string[]) => { try { - return await exec(`npx ts-node ${binFile} ${testArgs.join(" ")}`, { + return await exec(`node ${binFile} ${testArgs.join(" ")}`, { cwd, }); } catch (error) { From 5a097f7abb995650b5fb0f2ef2d2fb5878a692ce Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sat, 5 Oct 2019 09:06:20 +0900 Subject: [PATCH 4/5] Added tsc note to Testing.md --- docs/Testing.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/Testing.md b/docs/Testing.md index 3b28d335e..ffe5c7ea1 100644 --- a/docs/Testing.md +++ b/docs/Testing.md @@ -42,3 +42,5 @@ Within each directory, a test suite will execute `bin/tslint-to-eslint` and vali Use `npm run test:end-to-end:accept` to overwrite the expected contents of files with what is actually written. These behave similarly to updating snapshots in snapshot testing. + +> Note: these end-to-end tests use the compiled result of `npm run tsc`, so if you update source code, re-run `npm run tsc` before `npm run test:end-to-end`. \ No newline at end of file From 99fcd3212a3746288f38fec2dec0a1d25e767fc5 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sat, 5 Oct 2019 09:06:36 +0900 Subject: [PATCH 5/5] ...with a trailing endline --- docs/Testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Testing.md b/docs/Testing.md index ffe5c7ea1..b75bd5fa6 100644 --- a/docs/Testing.md +++ b/docs/Testing.md @@ -43,4 +43,4 @@ Within each directory, a test suite will execute `bin/tslint-to-eslint` and vali Use `npm run test:end-to-end:accept` to overwrite the expected contents of files with what is actually written. These behave similarly to updating snapshots in snapshot testing. -> Note: these end-to-end tests use the compiled result of `npm run tsc`, so if you update source code, re-run `npm run tsc` before `npm run test:end-to-end`. \ No newline at end of file +> Note: these end-to-end tests use the compiled result of `npm run tsc`, so if you update source code, re-run `npm run tsc` before `npm run test:end-to-end`.