stalniy/bdd-lazy-var

bdd-lazy-var/global doesn't work in Jest 28.1

anlek opened this issue · 2 comments

anlek commented

I tried to setup my jest to use bdd-lazy-var and I get the following issue:

    TypeError: Cannot read property 'getEnv' of undefined

      1 | /* global jest afterEach */
      2 |
    > 3 | const { get, def } = require("bdd-lazy-var/global");
        |                      ^
      4 |
      5 | import {
      6 |   buildHttpClientResponse,

      at Object.createUi (node_modules/bdd-lazy-var/global.js:663:46)

The line it references tries calling global$1.jasmine.getEnv().topSuite() and I'm not using jasmine, so I'm not sure why this is getting executed.

I'm using version: 2.6.1.

Any help would be appreciated.

anlek commented

I've tried setting in my jest config to: setupFilesAfterEnv: ["bdd-lazy-var/global"] and importing it into my own setup file. Both cases I get the same error.

Close as duplicate #97