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:[22m[24m
2017-11-09T14:31:15.5994040Z [1m DataModelDemoWebPart[22m
2017-11-09T14:31:15.6032850Z [32m ✔ should do something[39m
2017-11-09T14:31:15.6046220Z [32m
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 [32m09 11 2017 14:20:15.707:INFO [karma]: [39mKarma v0.13.22 server started at http://localhost:9876/
2017-11-09T14:20:15.7143615Z [32m09 11 2017 14:20:15.715:INFO [launcher]: [39mStarting browser PhantomJS
2017-11-09T14:20:15.7153617Z [36m09 11 2017 14:20:15.716:DEBUG [temp-dir]: [39mCreating temp dir at d:\a\_temp\karma-10341371
2017-11-09T14:20:15.7183610Z [36m09 11 2017 14:20:15.718:DEBUG [launcher]: [39mC:\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 [33m09 11 2017 14:20:25.715:WARN [launcher]: [39mPhantomJS have not captured in 10000 ms, killing.
2017-11-09T14:20:27.7184015Z [33m09 11 2017 14:20:27.719:WARN [launcher]: [39mPhantomJS was not killed in 2000 ms, sending SIGKILL.
2017-11-09T14:20:29.7195212Z [33m09 11 2017 14:20:29.720:WARN [launcher]: [39mPhantomJS was not killed by SIGKILL in 2000 ms, continuing.
2017-11-09T14:20:29.7195212Z [36m09 11 2017 14:20:29.720:DEBUG [launcher]: [39mProcess PhantomJS exited with code -1
2017-11-09T14:20:29.7205183Z [36m09 11 2017 14:20:29.721:DEBUG [temp-dir]: [39mCleaning temp dir d:\a\_temp\karma-10341371
2017-11-09T14:20:29.7240701Z [36m09 11 2017 14:20:29.724:DEBUG [launcher]: [39mPhantomJS failed (timeout). Not restarting.
2017-11-09T14:20:29.7250814Z [32m
2017-11-09T14:20:29.7250814Z Finished in 0 secs / 0 secs
2017-11-09T14:20:29.7250814Z
2017-11-09T14:20:29.7260813Z [39m[36m09 11 2017 14:20:29.726:DEBUG [karma]: [39mRun complete, exiting.
2017-11-09T14:20:29.7270811Z [36m09 11 2017 14:20:29.726:DEBUG [launcher]: [39mDisconnecting 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