Как я могу разрешить ситуацию, когда Jest хочет, чтобы для узла были построены собственные зависимости, но я строю их для Electron (используя npm rebuild --runtime=electron --target=2.0.2 --disturl=https://atom.io/download/atom-shell --build-from-source
)
Как заставить Jest использовать модули, созданные для Electron
или одновременно управлять обоими?
Узел 8.11.3
Пряжа 1.7.0
NPM 5.6.0
warning package.json: License should be a valid SPDX license expression
$ jest --no-cache --colors
FAIL app/redux/sagas/things/__tests__/database.test.js
● Test suite failed to run
Failed to load gRPC binary module because it was not installed for the current system
Expected directory: node-v57-win32-x64-unknown
Found: [electron-v2.0-win32-x64-unknown]
This problem can often be fixed by running "npm rebuild" on the current system
Original error: Cannot find module 'C:\projects\myApp\app\node_modules\grpc\src\node\extension_binary\node-v57-win32-x64-unknown\grpc_node.node' from 'grpc_extension.js'
> 1 | import firebase from 'firebase';
| ^
2 | import '@firebase/storage';
3 | import ReduxSagaFirebase from 'redux-saga-firebase';
4 | import validate from 'uuid-validate';
at Object.<anonymous> (app/node_modules/grpc/src/grpc_extension.js:53:17)
at Object.<anonymous> (app/node_modules/grpc/src/client_interceptors.js:145:12)
at Object.<anonymous> (app/node_modules/grpc/src/client.js:37:27)
at Object.<anonymous> (app/node_modules/grpc/index.js:30:14)
at Object.<anonymous> (app/node_modules/@firebase/firestore/dist/index.node.cjs.js:10:12)
at Object.<anonymous> (app/node_modules/firebase/dist/index.node.cjs.js:9:1)
at Object.<anonymous> (app/redux/sagas/rsf.js:1:1)
at Object.<anonymous> (app/redux/sagas/sagaHelpers.js:19:1)
at Object.<anonymous> (app/redux/sagas/things/database/general.js:6:1)
at Object.<anonymous> (app/redux/sagas/things/database.js:7:1)
at Object.<anonymous> (app/redux/sagas/things/__tests__/database.test.js:2:1)