From 4775c43878aa11f9547bf3c9bc170a06cb8803b6 Mon Sep 17 00:00:00 2001 From: jimmy-guzman Date: Tue, 30 Apr 2024 05:58:37 -0500 Subject: [PATCH] =?UTF-8?q?test:=20=E2=9C=85=20add=20integration=20for=20t?= =?UTF-8?q?sc=20against=20current=20fixtures?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/fixtures/integration/config/tsconfig.json | 9 +++++++++ tests/integration/test.ts | 16 ++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 tests/fixtures/integration/config/tsconfig.json diff --git a/tests/fixtures/integration/config/tsconfig.json b/tests/fixtures/integration/config/tsconfig.json new file mode 100644 index 00000000..b0982264 --- /dev/null +++ b/tests/fixtures/integration/config/tsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "target": "ESNext", + "module": "ESNext", + "moduleResolution": "Bundler", + "noEmit": true, + "allowJs": true + } +} diff --git a/tests/integration/test.ts b/tests/integration/test.ts index b79c1623..6ce4bee2 100644 --- a/tests/integration/test.ts +++ b/tests/integration/test.ts @@ -65,5 +65,21 @@ for (const dirent of fs.readdirSync(TEST_FIXTURES_ROOT, { } } }) + + it("should NOT fail when running tsc", () => { + try { + cp.execSync(`npx tsc`, { cwd: TEST_CWD }) + + assert.fail("Expect error") + } catch (e: any) { + const result = `${e.stdout}` + try { + assert.equal(result, "undefined") + } catch (e) { + console.error(e) + throw e + } + } + }) }) }