Thanks @matteobruni quite helpful.
I was able to test APIs with minor adjustments.
For context: My source is in src/ts including tests under src/ts/test. My compiles produce one js (under src/js-tmp) per source ts (under src/ts). My dists cherry-pick from js-tmp (i.e., exclude tests, ...).
src/ts
src/ts/test
src/js-tmp
=== test-whatever.ts === import chai, { expect } from 'chai' import chaiHttp from 'chai-http' chai.use(chaiHttp); import mocha from 'mocha' const { describe, before, beforeEach, it, after } = mocha : import { ..stuff to test.. } from '../index.js' === package.json === { .. "type": "module", "source": "src/js-tmp/index.js", "main": "src/js-tmp/index.js", ..} === tsconfigBase.json === { .. "esModuleInterop": true, "module": "es2022", "moduleResolution": "node", "target": "es2022" .. } === tsconfig.json === { "extends": "../../tsconfigBase.json", "compilerOptions": { "baseUrl": ".", "rootDir": "src/ts", "outDir": "src/js-tmp" }, "include": [ "src/ts/**/*.ts" ] }
`
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks @matteobruni quite helpful.
I was able to test APIs with minor adjustments.
For context: My source is in
src/ts
including tests undersrc/ts/test
. My compiles produce one js (undersrc/js-tmp
) per source ts (undersrc/ts
). My dists cherry-pick from js-tmp (i.e., exclude tests, ...).`