From 921adca2481adcedd0a910f596d619ba1b85f29c Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Tue, 23 Feb 2021 18:38:48 -0500 Subject: [PATCH] fix windows tests again --- src/index.spec.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/index.spec.ts b/src/index.spec.ts index a600a8caa..d69028808 100644 --- a/src/index.spec.ts +++ b/src/index.spec.ts @@ -587,8 +587,7 @@ test.suite('ts-node', (test) => { if (semver.gte(ts.version, '3.2.0')) { test('--show-config should log resolved configuration', async (t) => { - const rootDirEncoded = JSON.stringify(ROOT_DIR).slice(1, -1) - const rootDirNormalizedEncoded = JSON.stringify(ROOT_DIR.replace(/\\/g, '/')).slice(1, -1) + function normalize (path: string) { return path.replace(/\\/g, '/') } const { err, stdout } = await exec(`${cmd} --showConfig`) expect(err).to.equal(null) t.is(stdout, [ @@ -599,8 +598,8 @@ test.suite('ts-node', (test) => { ` "noEmit": false,`, ` "strict": true,`, ` "typeRoots": [`, - ` "${ rootDirNormalizedEncoded }/tests/typings",`, - ` "${ rootDirNormalizedEncoded }/node_modules/@types"`, + ` ${ JSON.stringify(normalize(`${ ROOT_DIR }/tests/typings`)) },`, + ` ${ JSON.stringify(normalize(`${ ROOT_DIR }/node_modules/@types`)) }`, ` ],`, ` "sourceMap": true,`, ` "inlineSourceMap": false,`, @@ -610,9 +609,9 @@ test.suite('ts-node', (test) => { ` "module": "commonjs"`, ` },`, ` "ts-node": {`, - ` "cwd": "${ rootDirEncoded }/tests",`, - ` "projectSearchDir": "${ rootDirEncoded }/tests",`, - ` "project": "${ rootDirEncoded }/tests/tsconfig.json",`, + ` "cwd": ${ JSON.stringify(`${ ROOT_DIR }/tests`) },`, + ` "projectSearchDir": ${ JSON.stringify(`${ ROOT_DIR }/tests`) },`, + ` "project": ${ JSON.stringify(`${ ROOT_DIR }/tests/tsconfig.json`) },`, ` "require": []`, ` }`, `}`,