jaredpalmer / tsdx

Zero-config CLI for TypeScript package development
https://tsdx.io
MIT License
11.2k stars 505 forks source link

Not able to run test when creating new library due to typescript v5 #1174

Open leobastiani opened 1 year ago

leobastiani commented 1 year ago

Current Behavior

npx tsdx create mylib cd mylib yarn test

❯ yarn test
yarn run v1.22.19
$ tsdx test
 FAIL  test/blah.test.ts
  ● Test suite failed to run

    TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined

      at node_modules/tsdx/node_modules/ts-jest/dist/compiler/compiler-utils.js:19:27
          at Array.map (<anonymous>)
      at Object.cacheResolvedModules (node_modules/tsdx/node_modules/ts-jest/dist/compiler/compiler-utils.js:18:14)
      at compileFn (node_modules/tsdx/node_modules/ts-jest/dist/compiler/language-service.js:127:38)
      at Object.compile (node_modules/tsdx/node_modules/ts-jest/dist/compiler/instance.js:52:21)
      at TsJestTransformer.process (node_modules/tsdx/node_modules/ts-jest/dist/ts-jest-transformer.js:85:41)
      at ScriptTransformer.transformSource (node_modules/@jest/transform/build/ScriptTransformer.js:481:35)
      at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:586:40)

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        3.302s
Ran all test suites.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Suggested solution(s)

Downgrading typescript to v4 solves the problem