Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use with Jest Node Environments? #1618

Closed
vinialbano opened this issue Apr 16, 2018 · 1 comment
Closed

How to use with Jest Node Environments? #1618

vinialbano opened this issue Apr 16, 2018 · 1 comment
Labels

Comments

@vinialbano
Copy link

Issue description or question

I am trying to test my MongoDB repositories with this implementation /~https://github.com/vladgolubev/jest-mongodb

It works normally when using Jest alone, but when I try to use with Wallaby, I get the following error:

TypeError: Cannot read property 'getConnectionString' of undefined at MongoEnvironment.setup (<path>/mongo-environment.js:11:56) at <path>/node_modules/jest-runner/build/run_test.js:71:23 at Generator.next (<anonymous>) at step (<path>/node_modules/jest-runner/build/run_test.js:147:191) at <path>/node_modules/jest-runner/build/run_test.js:147:437 at Promise (<anonymous>) at <path>/node_modules/jest-runner/build/run_test.js:147:99 at runTestInternal (<path>/node_modules/jest-runner/build/run_test.js:103:17) at <path>/node_modules/jest-runner/build/run_test.js:161:23 at Generator.next (<anonymous>) at step (<path>/node_modules/jest-runner/build/run_test.js:147:191) at <path>/node_modules/jest-runner/build/run_test.js:147:437 at Promise (<anonymous>) at <path>/node_modules/jest-runner/build/run_test.js:147:99 at runTest (<path>/node_modules/jest-runner/build/run_test.js:174:18) at <path>/node_modules/jest-runner/build/index.js:67:64 at Generator.next (<anonymous>) at step (<path>/node_modules/jest-runner/build/index.js:29:191) at <path>/node_modules/jest-runner/build/index.js:29:361 at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7)

How can I make it work? It seems that Wallaby can't run the Jest Setup file.

Wallaby.js configuration file

module.exports = function () {
  return {
    files: [
      '/app/**/*.js',
      '!/app/**/__tests__/*.js'
    ],
    tests: [
      'app/**/__tests__/*.js'
    ],
    env: {
      type: 'node',
      runner: 'node'
    },
    testFramework: 'jest'
  }
}

Code editor or IDE name and version

WebStorm v2017.2.2

OS name and version

OSX 10.13.4

@ArtemGovorov
Copy link
Member

Thanks for providing the repo. There was a bug with Jest globalSetup support in wallaby. The issue is fixed and the fix is published in the latest core version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants