_feature_をリクエストしますか、それとも_bug_を報告しますか?
バグ。
現在の動作は何ですか?
故意に失敗したテストは、Jest16によって合格として報告されます。 Jest14は正しくテストに失敗します。
Jest 16の出力は次のとおりです(下のJest 14の出力を参照)。
$ npm test
> @ test /Users/macbook/Documents/work/jest-relay-integration-test
> jest
PASS __tests__/Me-test-int.js
PASS __tests__/SignIn-test.js
Test Suites: 2 passed, 2 total
Tests: 2 passed, 2 total
Snapshots: 0 total
Time: 9.316s
Ran all test suites.
現在の動作がバグである場合は、再現する手順と、可能であればGitHubにnpm install
とnpm test
最小限のリポジトリを提供してください。
これが再現のレポです。
https://github.com/GrigoryPtashko/jest-relay-integration-test
冗談16のマスターブランチ
jest14とjest14ブランチ
クローンを作成し、npm installを実行するだけで、すべてが自分で表示されます。 ブランチを使用して、Jestのバージョンを切り替えます。
期待される動作は何ですか?
期待される動作-再現でのテストは失敗する必要があります。 失敗したリレー統合テストだからです。
Jest14からの正しい出力は次のとおりです。
$ npm test
> @ test /Users/macbook/Documents/work/jest-relay-integration-test
> jest
Using Jest CLI v14.1.0, jasmine2
PASS __tests__/SignIn-test.js (3.062s)
FAIL __tests__/Me-test-int.js (4.405s)
● Me › it can make request to /q anyway
- Expected 'ROLE_ANONYMOUS' to equal 'ROLE_ANONYMOUS_AAA'.
at AppRoot.render (__tests__/Me-test-int.js:39:61)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
1 test failed, 1 test passed (2 total in 2 test suites, run time 6.087s)
npm ERR! Test failed. See above for more details.
--debug
を使用してJestを再度実行し、印刷する完全な構成を提供します。
$ npm --version
3.10.7
$ node --version
v6.3.0
$ ./node_modules/.bin/jest --debug
jest version = 16.0.1
test framework = jasmine2
config = {
"scriptPreprocessor": "/Users/macbook/Documents/work/jest-relay-integration-test/jestPreprocessor.js",
"moduleNameMapper": [
[
"^.+\\.(scss)$",
"/Users/macbook/Documents/work/jest-relay-integration-test/src/styleMock.js"
]
],
"rootDir": "/Users/macbook/Documents/work/jest-relay-integration-test",
"name": "-Users-macbook-Documents-work-jest-relay-integration-test",
"setupFiles": [],
"testRunner": "/Users/macbook/Documents/work/jest-relay-integration-test/node_modules/jest-jasmine2/build/index.js",
"automock": false,
"bail": false,
"browser": false,
"cacheDirectory": "/var/folders/cs/dzn14j_s1ns7bqbtb5_3w72c0000gn/T/jest",
"clearMocks": false,
"coveragePathIgnorePatterns": [
"/node_modules/"
],
"coverageReporters": [
"json",
"text",
"lcov",
"clover"
],
"globals": {},
"haste": {
"providesModuleNodeModules": []
},
"mocksPattern": "__mocks__",
"moduleDirectories": [
"node_modules"
],
"moduleFileExtensions": [
"js",
"json",
"jsx",
"node"
],
"modulePathIgnorePatterns": [],
"noStackTrace": false,
"notify": false,
"preset": null,
"preprocessorIgnorePatterns": [
"/node_modules/"
],
"resetModules": false,
"testEnvironment": "jest-environment-jsdom",
"testPathDirs": [
"/Users/macbook/Documents/work/jest-relay-integration-test"
],
"testPathIgnorePatterns": [
"/node_modules/"
],
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.jsx?$",
"testURL": "about:blank",
"timers": "real",
"useStderr": false,
"verbose": null,
"watch": false,
"cache": true,
"watchman": true,
"testcheckOptions": {
"times": 100,
"maxSize": 200
}
}
PASS __tests__/SignIn-test.js
PASS __tests__/Me-test-int.js
Test Suites: 2 passed, 2 total
Tests: 2 passed, 2 total
Snapshots: 0 total
Time: 4.587s, estimated 5s
Ran all test suites.
@cpojerこれを見て
私はここに最新のJestを備えた作業バージョンを持っています: https :
この問題の後でそれを理解してください: //github.com/facebook/jest/issues/2071
将来の研究者のためにここに私の5セントがあります。 @sibeliusのおかげで、最新のJest
で動作するようになりました。これは、
最も参考になるコメント
@cpojerこれを見て