Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cspotcode committed Apr 17, 2022
1 parent cd107ed commit b6e01c8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 3 additions & 4 deletions src/test/repl/repl-environment.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -430,7 +429,7 @@ test.suite(

// Note: vanilla node uses different name. See #1360
stackTest: expect.stringContaining(
` at ${join(ROOT_DIR, '<repl>.ts')}:1:`
` at ${join(TEST_DIR, '<repl>.ts')}:1:`
),
},
});
Expand All @@ -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, '<repl>.ts')}:1:`
` at ${join(TEST_DIR, '<repl>.ts')}:1:`
),
moduleAccessorsTest: true,
},
Expand Down
4 changes: 2 additions & 2 deletions src/test/repl/repl.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`) +
Expand Down

0 comments on commit b6e01c8

Please sign in to comment.