samedi 17 septembre 2016

Meteor react jest testing

Simple jest test just to check if the react component can render and it fails because I import

import { Meteor } from 'meteor/meteor'

the full error is...

 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'm going to assume its becuase meteor doesn't build and thefore meteor/meteor doesn't exist, any help in getting this to work will be appreciated. :)

Aucun commentaire:

Enregistrer un commentaire