josdejong/mathjs

TypeError: Cannot read property 'prototype' of undefined when run in jest

Offen

#1.898 geöffnet am 28.06.2020

 (7 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (1.314 Forks)batch import
help wanted

Repository-Metriken

Stars
 (15.065 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

yarn jest --testPathPattern path/to/file
yarn run v1.22.4
$ D:\workspace\js\myproject\node_modules\.bin\jest --testPathPattern path/to/file
 FAIL  path/to/xxx.spec.ts
  ● Test suite failed to run

      ● Test suite failed to run

        TypeError: Cannot read property 'prototype' of undefined

      at Object.<anonymous>.createComplexClass.isClass (node_modules/mathjs/lib/type/complex/Complex.js:28:23)
      at assertAndCreate (node_modules/mathjs/lib/utils/factory.js:49:12)
      at Object.<anonymous> (node_modules/mathjs/lib/entry/pureFunctionsAny.generated.js:24:38)
      at Object.<anonymous> (node_modules/mathjs/lib/entry/mainAny.js:53:25)

It can be produced with the latest at least three versions. It works fine in my project when run the project by running npm run start. Why this is not working with jest.

Contributor Guide