Calahad
Calahad

Reputation: 1488

npm karma phantomJS undefined is not a constructor

When running tests for a react-redux application with Karma, they were all passing with webkit but failing with phantomJS with the following error:

TypeError: undefined is not a constructor (evaluating 'Object.assign({} [...]

This would also crash the test runner.

Upvotes: 8

Views: 3214

Answers (1)

Calahad
Calahad

Reputation: 1488

Installing and configuring phantomjs-polyfill-object-assign fixed the issue.

See https://www.npmjs.com/package/phantomjs-polyfill-object-assign

Upvotes: 16

Related Questions