Wallaby on a build server (CI)

2019-08-07 21:36发布

问题:

we are currently using Wallaby.js for javascript unit testing. Works fine and is great. But within our development pipeline we of course want to run the same tests on the build server - in our case a tfs.

  • Is it possible to use wallaby on a tfs build server? Anf if yes how?
  • If not, what is the way to go to run the wallaby configured unit tests on the build server?

As we used the karma test runner earlier, I tried to execute the new test configuration with it but then I get

Can't find variable: wallaby

as in our main/ starting test file it is written

wallaby.delayStart();

require.config({
    baseUrl: 'app',

(Originally from a karma/ requirejs configuration)

How to get around this?

Has anyone experience in this scenario?

回答1:

Wallaby.js main idea is to integrate with editors, run tests for the code that you change and display the results in the editor. You can't use Wallaby.js in a CI build.

You may consider invoking other test runners, or use grunt/gulp task instead for javascript unit testing.



回答2:

In TFS 2012 and later (might work in 2010 but not sure) you can extend the testing capabilities of the build system.

Check out these posts -

http://www.aspnetperformance.com/post/Unit-testing-JavaScript-as-part-of-TFS-Build.aspx

https://blogs.msdn.microsoft.com/visualstudioalm/2012/07/09/javascript-unit-tests-on-team-foundation-service-with-chutzpah/