Skip to content

Jest issues tracker #7200

Closed
Closed
@sokra

Description

@sokra

@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".

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions