From 01d7ecd3fa176063413ecc675013e3d8771bfee6 Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Sun, 6 Feb 2022 20:46:33 -0500 Subject: [PATCH] implement #1435 (#1628) --- src/test/index.spec.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/index.spec.ts b/src/test/index.spec.ts index fb7870bc2..d4163ffdf 100644 --- a/src/test/index.spec.ts +++ b/src/test/index.spec.ts @@ -79,6 +79,14 @@ test.suite('ts-node', (test) => { testsDirRequire.resolve('ts-node/node16/tsconfig.json'); }); + test('should not load typescript outside of loadConfig', async () => { + const { err, stdout } = await exec( + `node -e "require('ts-node'); console.dir(Object.keys(require.cache).filter(k => k.includes('node_modules/typescript')).length)"` + ); + expect(err).toBe(null); + expect(stdout).toBe('0\n'); + }); + test.suite('cli', (test) => { test('should execute cli', async () => { const { err, stdout } = await exec(