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

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

Closed
gh640 opened this issue Mar 5, 2024 · 3 comments
Closed

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

gh640 opened this issue Mar 5, 2024 · 3 comments

Comments

@gh640
Copy link
Owner

gh640 commented Mar 5, 2024

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

#115 で発生しました。

❯ npm run test:unit

> [email protected] test:unit
> NODE_OPTIONS=--experimental-vm-modules jest __tests__/unit

 FAIL  __tests__/unit/handlers/reverse.test.js
  ● Test suite failed to run

    TypeError: page.removeListener is not a function

      at PuppeteerEnvironment.teardown (node_modules/jest-environment-puppeteer/lib/env.js:227:18)

 FAIL  __tests__/unit/handlers/hello.test.js
  ● Test suite failed to run

    TypeError: page.removeListener is not a function

      at PuppeteerEnvironment.teardown (node_modules/jest-environment-puppeteer/lib/env.js:227:18)

Test Suites: 2 failed, 2 total
Tests:       0 total
Snapshots:   0 total
Time:        0.432 s, estimated 1 s
Ran all test suites matching /__tests__\/unit/i.
@gh640
Copy link
Owner Author

gh640 commented Mar 5, 2024

過去の似たイシュー

@gh640
Copy link
Owner Author

gh640 commented Mar 5, 2024

jest-puppeteer が古いことが原因のようです。

package.json:

-    "jest-puppeteer": "^7.0.0",
+    "jest-puppeteer": "^10.0.1",

gh640 added a commit that referenced this issue Mar 5, 2024
@gh640
Copy link
Owner Author

gh640 commented Mar 5, 2024

jest-puppeteer を最新版にすると解消できました。

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

gh640 added a commit that referenced this issue Mar 5, 2024
@gh640 gh640 closed this as completed Mar 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant