Skip to content

1.x broken with latest Jest and Jasmine runner #371

@robross0606

Description

@robross0606

Bug

  • package version: 1.1.0
  • node version: 14.18.1
  • npm (or yarn) version: 6.14.12
  • jest version: 27.2.5

Relevant code or config

Use Jest v27 with Jasmine test runner configured in package.json:

  "jest": {
    "testEnvironment": "node",
    "testRunner": "jest-jasmine2",
    "setupFilesAfterEnv": [
      "jest-extended/all"
    ]
  }

What happened (please provide anything you think will help):

Results in errors on every test:

 FAIL  src/__tests__/ncp-context.test.js
  ● Test suite failed to run

    TypeError: Cannot redefine property: toBeAfter
        at Function.defineProperty (<anonymous>)

      at node_modules/jest-jasmine2/node_modules/expect/build/jestMatchersObject.js:103:14
          at Array.forEach (<anonymous>)
      at Object.<anonymous> (node_modules/jest-extended/dist/all/index.js:12:14)

 FAIL  src/__tests__/access.test.js
  ● Test suite failed to run

    TypeError: Cannot redefine property: toBeAfter
        at Function.defineProperty (<anonymous>)

      at node_modules/jest-jasmine2/node_modules/expect/build/jestMatchersObject.js:103:14
          at Array.forEach (<anonymous>)
      at Object.<anonymous> (node_modules/jest-extended/dist/all/index.js:12:14)

 FAIL  src/__tests__/client.test.js
  ● Test suite failed to run

    TypeError: Cannot redefine property: toBeAfter
        at Function.defineProperty (<anonymous>)

      at node_modules/jest-jasmine2/node_modules/expect/build/jestMatchersObject.js:103:14
          at Array.forEach (<anonymous>)
      at Object.<anonymous> (node_modules/jest-extended/dist/all/index.js:12:14)

 FAIL  src/__tests__/clientOptions.js
  ● Test suite failed to run

    TypeError: Cannot redefine property: toBeAfter
        at Function.defineProperty (<anonymous>)

      at node_modules/jest-jasmine2/node_modules/expect/build/jestMatchersObject.js:103:14
          at Array.forEach (<anonymous>)
      at Object.<anonymous> (node_modules/jest-extended/dist/all/index.js:12:14)

 FAIL  src/__tests__/request-context.test.js
  ● Test suite failed to run

    TypeError: Cannot redefine property: toBeAfter
        at Function.defineProperty (<anonymous>)

      at node_modules/jest-jasmine2/node_modules/expect/build/jestMatchersObject.js:103:14
          at Array.forEach (<anonymous>)
      at Object.<anonymous> (node_modules/jest-extended/dist/all/index.js:12:14)

 FAIL  src/__tests__/request-context-trace.test.js
  ● Test suite failed to run

    TypeError: Cannot redefine property: toBeAfter
        at Function.defineProperty (<anonymous>)

      at node_modules/jest-jasmine2/node_modules/expect/build/jestMatchersObject.js:103:14
          at Array.forEach (<anonymous>)
      at Object.<anonymous> (node_modules/jest-extended/dist/all/index.js:12:14)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions