Apakah Anda ingin meminta _fitur_ atau melaporkan _bug_?
Sebuah bug.
Apa perilaku saat ini?
Tes yang sengaja gagal dilaporkan oleh Jest 16 sebagai lulus. Jest 14 dengan benar gagal dalam tes.
Inilah output dari Jest 16 (lihat output untuk Jest 14 lebih rendah):
$ 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.
Jika perilaku saat ini adalah bug, berikan langkah-langkah untuk mereproduksi dan jika mungkin repositori minimal di GitHub yang dapat kami npm install
dan npm test
.
Inilah repo untuk repro.
https://github.com/GrigoryPtashko/jest-relay-integration-test
cabang utama dengan lelucon 16
cabang jest14 dengan jest 14
Cukup klon, instal npm dan Anda akan melihat semuanya sendiri. Gunakan cabang untuk beralih di antara versi Jest.
Apa perilaku yang diharapkan?
Perilaku yang diharapkan - tes dalam repro harus gagal. Karena ini adalah tes integrasi Relay yang gagal.
Inilah output yang benar dari Jest 14:
$ 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.
Jalankan Jest lagi dengan --debug
dan berikan konfigurasi lengkap yang dicetaknya.
$ 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 bisakah Anda melihat yang ini? Saya sangat ingin memperbarui ke 16 dari 14. Tapi saya tidak tahu caranya...
Saya memiliki versi yang berfungsi dengan Jest terbaru di sini: https://github.com/sibelius/relay-integration-test
cari tahu setelah masalah ini: https://github.com/facebook/jest/issues/2071
Untuk peneliti masa depan, inilah 5 sen saya. Terima kasih kepada @sibelius, saya membuatnya bekerja dengan Jest
dan ini dia https://github.com/GrigoryPtashko/jest-relay-integration-test.
Komentar yang paling membantu
@cpojer bisakah Anda melihat yang ini? Saya sangat ingin memperbarui ke 16 dari 14. Tapi saya tidak tahu caranya...