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

Unit tests broken for newly created project #760

Open
ElonVolo opened this issue Jun 6, 2022 · 2 comments
Open

Unit tests broken for newly created project #760

ElonVolo opened this issue Jun 6, 2022 · 2 comments

Comments

@ElonVolo
Copy link
Contributor

ElonVolo commented Jun 6, 2022

Describe the bug

When I create a new gluegun project using the Typescdript option and then run npm test the tests break.

To Reproduce
Steps to reproduce the behavior:

  1. Run the command gluegun new testapp
  2. Choose the option "TypeScript - Gives you a build pipeline out of the box (default)"
  3. When the project has finished generated, cd to testapp
  4. Run the command npm test
  5. See tests fail

Expected behavior

The unit tests for a newly created Typescript project pass.

Error Output


ts-jest[config] (WARN) Got `sourceMap: false` from tsconfig file "/Users/ilanvolow/Documents/Development/JavaScript/gluegun-test/testapp/tsconfig.json". This will disable source map support in ts-jest 27. Please set `sourceMap: true` in your tsconfig file "/Users/ilanvolow/Documents/Development/JavaScript/gluegun-test/testapp/tsconfig.json" if you want to keep source map support on
 FAIL  __tests__/cli-integration.test.ts
  ✕ outputs version (467 ms)
  ✕ outputs help (472 ms)
  ✕ generates file (461 ms)

  ● outputs version

    Command failed: node /Users/ilanvolow/Documents/Development/JavaScript/gluegun-test/testapp/bin/testapp --version

    /Users/ilanvolow/Documents/Development/JavaScript/gluegun-test/testapp/node_modules/typescript/lib/typescript.js:42536
            ts.Debug.assert(typeof typeReferenceDirectiveName === "string", "Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.");
                     ^
    Error: Debug Failure. False expression: Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.

      at Object.resolveTypeReferenceDirective (node_modules/typescript/lib/typescript.js:42536:18)
      at node_modules/ts-node/src/index.ts:623:55
          at Array.map (<anonymous>)
      at Object.resolveTypeReferenceDirectives (node_modules/ts-node/src/index.ts:622:33)
      at actualResolveTypeReferenceDirectiveNamesWorker (node_modules/typescript/lib/typescript.js:116673:163)
      at resolveTypeReferenceDirectiveNamesWorker (node_modules/typescript/lib/typescript.js:116973:26)
      at processTypeReferenceDirectives (node_modules/typescript/lib/typescript.js:118455:31)
      at findSourceFileWorker (node_modules/typescript/lib/typescript.js:118340:21)
      at findSourceFile (node_modules/typescript/lib/typescript.js:118195:26)
      at processImportedModules (node_modules/typescript/lib/typescript.js:118601:25)

  ● outputs help

    Command failed: node /Users/ilanvolow/Documents/Development/JavaScript/gluegun-test/testapp/bin/testapp --help

    /Users/ilanvolow/Documents/Development/JavaScript/gluegun-test/testapp/node_modules/typescript/lib/typescript.js:42536
            ts.Debug.assert(typeof typeReferenceDirectiveName === "string", "Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.");
                     ^
    Error: Debug Failure. False expression: Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.

      at Object.resolveTypeReferenceDirective (node_modules/typescript/lib/typescript.js:42536:18)
      at node_modules/ts-node/src/index.ts:623:55
          at Array.map (<anonymous>)
      at Object.resolveTypeReferenceDirectives (node_modules/ts-node/src/index.ts:622:33)
      at actualResolveTypeReferenceDirectiveNamesWorker (node_modules/typescript/lib/typescript.js:116673:163)
      at resolveTypeReferenceDirectiveNamesWorker (node_modules/typescript/lib/typescript.js:116973:26)
      at processTypeReferenceDirectives (node_modules/typescript/lib/typescript.js:118455:31)
      at findSourceFileWorker (node_modules/typescript/lib/typescript.js:118340:21)
      at findSourceFile (node_modules/typescript/lib/typescript.js:118195:26)
      at processImportedModules (node_modules/typescript/lib/typescript.js:118601:25)

  ● generates file

    Command failed: node /Users/ilanvolow/Documents/Development/JavaScript/gluegun-test/testapp/bin/testapp generate foo

    /Users/ilanvolow/Documents/Development/JavaScript/gluegun-test/testapp/node_modules/typescript/lib/typescript.js:42536
            ts.Debug.assert(typeof typeReferenceDirectiveName === "string", "Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.");
                     ^
    Error: Debug Failure. False expression: Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.

      at Object.resolveTypeReferenceDirective (node_modules/typescript/lib/typescript.js:42536:18)
      at node_modules/ts-node/src/index.ts:623:55
          at Array.map (<anonymous>)
      at Object.resolveTypeReferenceDirectives (node_modules/ts-node/src/index.ts:622:33)
      at actualResolveTypeReferenceDirectiveNamesWorker (node_modules/typescript/lib/typescript.js:116673:163)
      at resolveTypeReferenceDirectiveNamesWorker (node_modules/typescript/lib/typescript.js:116973:26)
      at processTypeReferenceDirectives (node_modules/typescript/lib/typescript.js:118455:31)
      at findSourceFileWorker (node_modules/typescript/lib/typescript.js:118340:21)
      at findSourceFile (node_modules/typescript/lib/typescript.js:118195:26)
      at processImportedModules (node_modules/typescript/lib/typescript.js:118601:25)

Test Suites: 1 failed, 1 total
Tests:       3 failed, 3 total
Snapshots:   0 total
Time:        2.098 s, estimated 3 s

Doctor (please complete the following information):

  • MacOS Monterey 12.4 Beta
  • Gluegun 5.1.2
  • node.js 18.3.0

Additional context

The tests pass when I npm install the latest version of ts-node.
.

@ElonVolo
Copy link
Contributor Author

ElonVolo commented Jun 6, 2022

One addition question I have is whether the addition typescript dependencies (e.g. Typescript) should be bumped up to their latest version (e.g. 4.7.3)?

@bennetthardwick
Copy link
Contributor

The fix I've got up for the ejs version also seems to fix this: #764

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

2 participants