A simple jest test to check if a component can respond and it fails because I import
import { Meteor } from 'meteor/meteor'
complete mistake ...
PASS imports/__partials/Navigation/__tests__/Navigation.jest.js PASS imports/__layouts/AuthLayout/__tests__/AuthLayout.jest.js FAIL imports/features/oAuth/ui/LoginLayout/__tests__/LoginLayout.jest.js β Test suite failed to run Cannot find module 'meteor/meteor' from 'index.js' at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:142:17) at Object.<anonymous> (imports/features/oAuth/ui/LoginLayout/index.js:2:41) at Object.<anonymous> (imports/features/oAuth/ui/LoginLayout/__tests__/LoginLayout.jest.js:4:40) PASS imports/staticTests/quickCheckboxTest/__tests__/CheckboxWithLabel.jest.js PASS imports/staticTests/quickLinkTest/__tests__/Link.react.jest.js
I am going to assume because the meteorite is not being built and therefore meteor/meteor does not exist, any help in its work will be appreciated. :)
Edit ...
I was right in my assumption, this is mainly because the meteor did not build npm modules.
javascript ecmascript-6 testing meteor jestjs
Jake lacey
source share