-
-
Couldn't load subscription status.
- Fork 544
Closed
rootstrap/node-ts-api-base
#1Labels
externalresearchNeeds design work, investigation, or prototyping. Implementation uncertain.Needs design work, investigation, or prototyping. Implementation uncertain.
Description
One neat trick to use tsconfig.json/paths is to pointing the module name to your source file:
// tsconfig.json of blue-tape-fixture
{
...
"paths": {
"blue-tape-fixture": [ "src/" ]
}
}This way, your test files can reference the source as if it is a proper module:

You can see it is working in vscode. But it does not when I run test with ts-node:
// package.json
{
"scripts": {
"test": "ts-node -P tsconfig.build.json node_modules/blue-tape/bin/blue-tape \"test/**/*.ts\" | tap-spec"
}
}The error is:
Error: Cannot find module 'blue-tape-fixture'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)You can see it here: https://github.com/unional/blue-tape-fixture/tree/ts-node
# clone
npm install
npm testfrederikschubert, acrazing, Jimeux, jonaskello, fabiospampinato and 148 more
Metadata
Metadata
Assignees
Labels
externalresearchNeeds design work, investigation, or prototyping. Implementation uncertain.Needs design work, investigation, or prototyping. Implementation uncertain.