Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

npm run test:unit のテストが失敗する #10

Closed
gh640 opened this issue Aug 4, 2021 · 2 comments
Closed

npm run test:unit のテストが失敗する #10

gh640 opened this issue Aug 4, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@gh640
Copy link
Owner

gh640 commented Aug 4, 2021

Node 16.5.x では成功したテストが Node 16.6.0 では失敗するようになりました。

  npm run test:unit
  shell: /usr/bin/bash -e {0}
  env:
    NODE_VERSION: 16

> express-jest-example-ja@1.0.0 test:unit
> NODE_OPTIONS=--experimental-vm-modules jest __tests__/unit

TypeError: String.prototype.startsWith called on null or undefined
    at startsWith (<anonymous>)
    at node:internal/errors:811:19
    at Array.filter (<anonymous>)
    at node:internal/errors:809:16
    at prepareStackTrace (node:internal/errors:96:12)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:38)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:94:18)
Error: Process completed with exit code 1.
@gh640 gh640 added the bug Something isn't working label Aug 4, 2021
@gh640
Copy link
Owner Author

gh640 commented Aug 4, 2021

ひとつ前のコメントのリンク先の Node 16.6.0 のバグが原因だったようです。 Node 16.6.1 で解消されました。

参考: nodejs/node#39593

テストが再び通るようになったので終了します。

https://github.com/gh640/express-jest-example-ja/actions/runs/1084474031

  npm run test:unit
  shell: /usr/bin/bash -e {0}
  env:
    NODE_VERSION: 16

> express-jest-example-ja@1.0.0 test:unit
> NODE_OPTIONS=--experimental-vm-modules jest __tests__/unit

(node:1609) ExperimentalWarning: VM Modules is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
PASS __tests__/unit/handlers/reverse.test.js
PASS __tests__/unit/handlers/hello.test.js

Test Suites: 2 passed, 2 total
Tests:       4 passed, 4 total
Snapshots:   0 total
Time:        0.564 s
Ran all test suites matching /__tests__\/unit/i.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant