Unit test error with "Fatal error: write after the end"

I run unit tests written in Jasmine in the PhantomJS browser using grunt-karma. The code I'm testing uses the browser.

When I run grunt karma, it loads my modules and then errors with Fatal error: write after end. The terminal output is shown below:

Camerons-MacBook-Pro:Bookmarklet cameronnokes$ grunt karma
Running "karma:unit" (karma) task
DEBUG [config]: autoWatch set to false, because of singleRun
DEBUG [plugin]: Loading karma-* from /Users/cameronnokes/Repositories/Bookmarklet/node_modules
DEBUG [plugin]: Loading plugin /Users/cameronnokes/Repositories/Bookmarklet/node_modules/karma-browserify.
DEBUG [plugin]: Loading plugin /Users/cameronnokes/Repositories/Bookmarklet/node_modules/karma-jasmine.
DEBUG [plugin]: Loading plugin /Users/cameronnokes/Repositories/Bookmarklet/node_modules/karma-phantomjs-launcher.
DEBUG [preprocessor.browserify (framework)]: Writing to temp file: "22844b46ae091ac715aedfae5d2497cb".
INFO [karma]: Karma v0.12.16 server started at http://localhost:9876/
INFO [launcher]: Starting browser PhantomJS
DEBUG [temp-dir]: Creating temp dir at /var/folders/vs/zn48bjc56pj8b606y4db_k5m0000gn/T/karma-98875158
DEBUG [launcher]: /usr/local/bin/phantomjs /var/folders/vs/zn48bjc56pj8b606y4db_k5m0000gn/T/karma-98875158/capture.js
DEBUG [preprocessor.browserify]: Processing "/Users/cameronnokes/Repositories/Bookmarklet/test/test/content.test.js".
DEBUG [preprocessor.browserify]: Processing "/Users/cameronnokes/Repositories/Bookmarklet/test/test/messaging.test.js".
DEBUG [preprocessor.browserify]: Processing "/Users/cameronnokes/Repositories/Bookmarklet/test/test/store.test.js".
DEBUG [preprocessor.browserify]: Processing "/Users/cameronnokes/Repositories/Bookmarklet/test/test/tracking.test.js".
Fatal error: write after end

An error starting this error does not cause anything. Anyone have any ideas on what is going on here? (Let me know if you need me to provide additional information).

+4
source share
1 answer

, require , .

, :

npm install --save-dev browserify@^4.0.0

:

$ npm list browserify
app/
├── browserify@4.2.3
├─┬ gulp-browserify@0.4.6
│ └── browserify@3.46.1
└─┬ watchify@1.0.6
  └── browserify@5.13.1
+2

Source: https://habr.com/ru/post/1544840/


All Articles