diff --git a/package.json b/package.json index 48fa3a519..131049632 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ ], "scripts": { "lint": "prettier --check .", - "lint-fix": "prettier --write .", + "lint-fix": "prettier --loglevel warn --write .", "clean": "rimraf dist tsconfig.schema.json tsconfig.schemastore-schema.json tsconfig.tsbuildinfo tests/ts-node-packed.tgz", "rebuild": "npm run clean && npm run build", "build": "npm run build-nopack && npm run build-pack", diff --git a/src/test/repl/repl-environment.spec.ts b/src/test/repl/repl-environment.spec.ts index f54d2030e..50c68255f 100644 --- a/src/test/repl/repl-environment.spec.ts +++ b/src/test/repl/repl-environment.spec.ts @@ -137,7 +137,6 @@ test.suite( /** Every possible ./node_modules directory ascending upwards starting with ./tests/node_modules */ const modulePaths = createModulePaths(TEST_DIR); - const rootModulePaths = createModulePaths(ROOT_DIR); function createModulePaths(dir: string) { const modulePaths: string[] = []; for (let path = dir; ; path = dirname(path)) { @@ -430,7 +429,7 @@ test.suite( // Note: vanilla node uses different name. See #1360 stackTest: expect.stringContaining( - ` at ${join(ROOT_DIR, '.ts')}:1:` + ` at ${join(TEST_DIR, '.ts')}:1:` ), }, }); @@ -455,13 +454,13 @@ test.suite( modulePath: '.', moduleFilename: null, modulePaths: expect.objectContaining({ - ...[join(ROOT_DIR, `repl/node_modules`), ...rootModulePaths], + ...[join(TEST_DIR, `repl/node_modules`), ...modulePaths], }), // Note: vanilla node REPL does not set exports exportsTest: true, // Note: vanilla node uses different name. See #1360 stackTest: expect.stringContaining( - ` at ${join(ROOT_DIR, '.ts')}:1:` + ` at ${join(TEST_DIR, '.ts')}:1:` ), moduleAccessorsTest: true, }, diff --git a/src/test/repl/repl.spec.ts b/src/test/repl/repl.spec.ts index d23ed445e..40ea33fc5 100644 --- a/src/test/repl/repl.spec.ts +++ b/src/test/repl/repl.spec.ts @@ -246,13 +246,13 @@ test.suite('top level await', (_test) => { 'should error with typing information when importing a file with type errors', async (t) => { const { stdout, stderr } = await t.context.executeInTlaRepl( - `const {foo} = await import('./tests/repl/tla-import');`, + `const {foo} = await import('./repl/tla-import');`, 'error' ); expect(stdout).toBe('> > '); expect(stderr.replace(/\r\n/g, '\n')).toBe( - 'tests/repl/tla-import.ts(1,14): error TS2322: ' + + 'repl/tla-import.ts(1,14): error TS2322: ' + (semver.gte(ts.version, '4.0.0') ? `Type 'number' is not assignable to type 'string'.\n` : `Type '1' is not assignable to type 'string'.\n`) +