Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 268
Calahad Avatar asked Apr 19 '16 01:04

Calahad


1 Answers

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

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

like image 104
Calahad Avatar answered Sep 28 '22 06:09

Calahad