SPFx -- build in VSTS -- run tests with gulp test -- error

Occasional Visitor

 

Note: unit tests will run when in VSTS build I choose the "Linux" build agent.  Fails for the standard (Windows) build agent.

 

Output from Linux build agent

2017-11-09T14:31:15.5976220Z Start:
2017-11-09T14:31:15.5994040Z  DataModelDemoWebPart
2017-11-09T14:31:15.6032850Z  ✔ should do something
2017-11-09T14:31:15.6046220Z 
2017-11-09T14:31:15.6059290Z Finished in 0.041 secs / 0 secs

 

Is it just as simple as adding a gulp with "test" the parameter for "Gulp Task(s)"?  When I try this, I get a karma error that I don't get when running "gulp test" locally.   I have added PhantomJS with a --save-dev to the project.

 

2017-11-09T14:20:15.7107095Z 09 11 2017 14:20:15.707:INFO [karma]: Karma v0.13.22 server started at http://localhost:9876/
2017-11-09T14:20:15.7143615Z 09 11 2017 14:20:15.715:INFO [launcher]: Starting browser PhantomJS
2017-11-09T14:20:15.7153617Z 09 11 2017 14:20:15.716:DEBUG [temp-dir]: Creating temp dir at d:\a\_temp\karma-10341371
2017-11-09T14:20:15.7183610Z 09 11 2017 14:20:15.718:DEBUG [launcher]: C:\NPM\Modules\node_modules\karma-phantomjs-launcher\phantomjs-prebuilt\lib\phantom\bin\phantomjs d:\a\_temp\karma-10341371/capture.js
2017-11-09T14:20:25.7151510Z 09 11 2017 14:20:25.715:WARN [launcher]: PhantomJS have not captured in 10000 ms, killing.
2017-11-09T14:20:27.7184015Z 09 11 2017 14:20:27.719:WARN [launcher]: PhantomJS was not killed in 2000 ms, sending SIGKILL.
2017-11-09T14:20:29.7195212Z 09 11 2017 14:20:29.720:WARN [launcher]: PhantomJS was not killed by SIGKILL in 2000 ms, continuing.
2017-11-09T14:20:29.7195212Z 09 11 2017 14:20:29.720:DEBUG [launcher]: Process PhantomJS exited with code -1
2017-11-09T14:20:29.7205183Z 09 11 2017 14:20:29.721:DEBUG [temp-dir]: Cleaning temp dir d:\a\_temp\karma-10341371
2017-11-09T14:20:29.7240701Z 09 11 2017 14:20:29.724:DEBUG [launcher]: PhantomJS failed (timeout). Not restarting.
2017-11-09T14:20:29.7250814Z 
2017-11-09T14:20:29.7250814Z Finished in 0 secs / 0 secs
2017-11-09T14:20:29.7250814Z
2017-11-09T14:20:29.7260813Z 09 11 2017 14:20:29.726:DEBUG [karma]: Run complete, exiting.
2017-11-09T14:20:29.7270811Z 09 11 2017 14:20:29.726:DEBUG [launcher]: Disconnecting all browsers
2017-11-09T14:20:29.7311006Z [14:20:29] Warning - [karma] Error(s) occured during karma.
2017-11-09T14:20:29.7311006Z [14:20:29] Finished subtask 'karma' after 16 s
 
 
0 Replies