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

Jest issues tracker #7200

Closed
9 tasks
sokra opened this issue May 4, 2018 · 5 comments
Closed
9 tasks

Jest issues tracker #7200

sokra opened this issue May 4, 2018 · 5 comments
Labels

Comments

@sokra
Copy link
Member

sokra commented May 4, 2018

@niieani

  • afterAll and beforeAll are called even if the test cases are skipped

  • running test suites with all test cases skipped takes very long time

  • yarn test:integration -t runtime-chunk --watch on node.js v10.0.0 (windows) causes this:

[6904]: src\fs_event_wrap.cc:90: Assertion `wrap != nullptr' failed.
 1: node::DecodeWrite
 2: node::DecodeWrite
 3: node::Start
 4: v8::internal::interpreter::BytecodeDecoder::Decode
 5: v8::internal::RegExpImpl::Exec
 6: v8::internal::RegExpImpl::Exec
 7: v8::internal::Object::ToInt32
 8: v8::internal::Object::GetProperty
 9: v8::internal::NativesCollection<0>::GetScriptsSource
10: v8::internal::NativesCollection<0>::GetScriptsSource
11: 0000022CAD704281
error Command failed with exit code 134.
  • The WatchDetection suite cause jest crashing in watch mode

Investigation: When running jest in watch mode and running the WatchDetection test, sane emits EPERM errors on windows. sane doesn't seem to check the ignore list when directories are added (https://github.com/amasad/sane/blob/master/src/node_watcher.js#L310) and reading the stats from a removed file seem to cause an EPERM error here (https://github.com/amasad/sane/blob/master/src/node_watcher.js#L306). I believe it's an sane issue. Although it would also be great if watcher errors would be catched (via watcher.on("error")) in jest-haste-map.

events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: EPERM: operation not permitted, lstat 'D:\Repos\webpack\test\fixtures\temp-1600\file2.js'
error Command failed with exit code 1.
  • random error in watch mode, occurred only once
D:\Repos\webpack\node_modules\jest-runtime\build\index.js:581
    const wrapper = this._environment.runScript(transformedFile.script)[
                                                                       ^

TypeError: Cannot read property 'Object.<anonymous>' of null
    at Runtime._execModule (D:\Repos\webpack\node_modules\jest-runtime\build\index.js:581:72)
    at Runtime.requireModule (D:\Repos\webpack\node_modules\jest-runtime\build\index.js:365:14)
    at Runtime.requireModuleOrMock (D:\Repos\webpack\node_modules\jest-runtime\build\index.js:449:19)
    at readdir (D:\Repos\webpack\node_modules\readdirp\readdirp.js:55:25)
    at FSWatcher.<anonymous> (D:\Repos\webpack\node_modules\chokidar\lib\nodefs-handler.js:356:5)
    at FSWatcher.Object.<anonymous>.NodeFsHandler._handleDir (D:\Repos\webpack\node_modules\chokidar\lib\nodefs-handler.js:407:18)
    at FSWatcher.<anonymous> (D:\Repos\webpack\node_modules\chokidar\lib\nodefs-handler.js:456:19)
    at FSWatcher.<anonymous> (D:\Repos\webpack\node_modules\chokidar\lib\nodefs-handler.js:461:16)
    at D:\Repos\webpack\node_modules\graceful-fs\polyfills.js:287:18
    at FSReqWrap.oncomplete (fs.js:153:5)
  • CI is hanging
(node:2612) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'spies' of undefined
(node:2612) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2612) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Could be related to jest-jasmine2...

https://travis-ci.org/webpack/webpack/jobs/374782908
https://travis-ci.org/webpack/webpack/jobs/374782909
https://ci.appveyor.com/project/sokra/webpack/build/1.0.7531/job/7m1jbsafpkt4sh5o

forceExit: true didn't help

  • There is no shortcut for --testPathPattern i. e. -p similar to -t

  • watch mode with single test suite and a lot of skipped test cases is very spammy

Example:

yarn test:integration -t runtime-chunk --watch --testPathPattern ConfigTestCases

Prints:

 PASS  test\ConfigTestCases.test.js
  ConfigTestCases
    additional-pass
      simple
        ○ skipped 1 test
    async-commons-chunk
      all-selected
        ○ skipped 1 test
      duplicate
        ○ skipped 1 test
      existing-name
        ○ skipped 1 test
      nested
        ○ skipped 1 test
      node
        ○ skipped 1 test
      simple
        ○ skipped 1 test
    code-generation
      require-context-id
        ○ skipped 1 test
      use-strict
        ○ skipped 1 test
... (many many lines)
      runtime-chunk
        √ runtime-chunk should compile (754ms)
        exported tests
          √ should be able to load the split chunk on demand (6ms)
      runtime-chunk-no-async
        √ runtime-chunk-no-async should compile (105ms)
        exported tests
          √ should compile and evaluate fine
    target
      buffer
        ○ skipped 1 test
      buffer-default
        ○ skipped 1 test
... (some more lines)
  • This message appears:
    "transformIgnorePatterns": [
      "<rootDir>/"
    ]
[BABEL] Note: The code generator has deoptimised the styling of "/home/travis/build/webpack/webpack/node_modules/text-encoding/lib/encoding-indexes.js" as it exceeds the max of "500KB".
@niieani
Copy link
Contributor

niieani commented May 14, 2018

@sokra To address the CI hanging sometimes, this latest jest feature (pending release) can be helpful:
jestjs/jest#6130

I'll look into other issues once I have a bit more time.

@SimenB
Copy link
Contributor

SimenB commented May 16, 2018

I can try to answer some of these.

afterAll and beforeAll are called even if the test cases are skipped

jestjs/jest#6166

The WatchDetection suite cause jest crashing in watch mode

Maybe open up an issue with sane?

random error in watch mode, occurred only once

That's an odd one, that should get a clearer error after jestjs/jest#5888. The code in the stack doesn't look like that any more. I thought that PR was included in the version you used here, but maybe not.

There is no shortcut for --testPathPattern i. e. -p similar to -t

jest some-pattern is that one. It's sorta weird we have --testPathPattern at all, really

watch mode with single test suite and a lot of skipped test cases is very spammy

@rickhanlonii thoughts on that one?

this latest jest feature (pending release) can be helpful:
jestjs/jest#6130

That's available in jest@beta now, FWIW.

@rickhanlonii
Copy link
Contributor

rickhanlonii commented May 18, 2018

For the skipped tests you could add a custom reporter until we address in core

I'm happy to write one for you if you'd like!

@webpack-bot
Copy link
Contributor

This issue had no activity for at least half a year.

It's subject to automatic issue closing if there is no activity in the next 15 days.

@webpack-bot
Copy link
Contributor

Issue was closed because of inactivity.

If you think this is still a valid issue, please file a new issue with additional information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants