Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run tests: unable to compile typescript #11

Closed
mhansen opened this issue Aug 23, 2020 · 0 comments
Closed

Can't run tests: unable to compile typescript #11

mhansen opened this issue Aug 23, 2020 · 0 comments

Comments

@mhansen
Copy link
Owner

mhansen commented Aug 23, 2020

mocha -r ts-node/register tests/test.ts

/usr/local/lib/node_modules/ts-node/src/index.ts:307
        throw new TSError(formatDiagnostics(diagnosticList, cwd, ts, lineOffset))
              ^
TSError: ⨯ Unable to compile TypeScript
tests/test.ts (1,25): Cannot find module 'assert' or its corresponding type declarations. (2307)
tests/test.ts (2,21): Cannot find module 'fs' or its corresponding type declarations. (2307)
    at getOutput (/usr/local/lib/node_modules/ts-node/src/index.ts:307:15)
    at /usr/local/lib/node_modules/ts-node/src/index.ts:336:16
    at Object.compile (/usr/local/lib/node_modules/ts-node/src/index.ts:498:11)
    at Module.m._compile (/usr/local/lib/node_modules/ts-node/src/index.ts:392:43)
    at Module._extensions..js (internal/modules/cjs/loader.js:1277:10)
    at Object.require.extensions.<computed> [as .ts] (/usr/local/lib/node_modules/ts-node/src/index.ts:395:12)
    at Module.load (internal/modules/cjs/loader.js:1105:32)
    at Function.Module._load (internal/modules/cjs/loader.js:967:14)
    at Module.require (internal/modules/cjs/loader.js:1145:19)
    at require (internal/modules/cjs/helpers.js:75:18)
    at /usr/local/lib/node_modules/mocha/lib/mocha.js:231:27
    at Array.forEach (<anonymous>)
    at Mocha.loadFiles (/usr/local/lib/node_modules/mocha/lib/mocha.js:228:14)
    at Mocha.run (/usr/local/lib/node_modules/mocha/lib/mocha.js:514:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/mocha/bin/_mocha:480:18)
    at Module._compile (internal/modules/cjs/loader.js:1256:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1277:10)
    at Module.load (internal/modules/cjs/loader.js:1105:32)
    at Function.Module._load (internal/modules/cjs/loader.js:967:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant