swpp201901-team06 / swpp-project

1 stars 2 forks source link

Test suite failed to run: Cannot find module 'worker_threads' from 'index.test.js' #57

Closed lionminhu closed 5 years ago

lionminhu commented 5 years ago

For the most recent commit (https://github.com/swpp201901-team06/swpp-project/commit/9020fd1f06178f28a34b36510fc3e177ba3c597c), I've confirmed that running npm test results in all tests passing:

Test Suites: 38 passed, 38 total
Tests:       155 passed, 155 total
Snapshots:   0 total
Time:        3.997s
Ran all test suites.

The Travis report tells us otherwise, however:

 FAIL  src/components/pages/ArchivePage/molecules/ArchiveReviewDetail/index.test.js
  ● Test suite failed to run
    Cannot find module 'worker_threads' from 'index.test.js'

      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:169:17)
      at Object.<anonymous> (src/components/pages/ArchivePage/molecules/ArchiveReviewDetail/index.test.js:4:23)
lionminhu commented 5 years ago

The code for src/components/pages/ArchivePage/molecules/ArchiveReviewDetail/index.test.js is as below: https://github.com/swpp201901-team06/swpp-project/blob/9020fd1f06178f28a34b36510fc3e177ba3c597c/FD_frontend/src/components/pages/ArchivePage/molecules/ArchiveReviewDetail/index.test.js#L1-L10

I have no clue where the worker_threads module came from, nor do I have an idea why I imported it along with the addition of placeholder tests: img

I'll remove the import and see if Travis test passes.

lionminhu commented 5 years ago

Travis test passes (https://github.com/swpp201901-team06/swpp-project/commit/313ce3fdc452958e835a6bfaba80489588ddda88). I'll open a pull request.