-1

I want Jenkins to run JavaScript unit tests.

Although I came across different JavaScript unit test frameworks, like Jasmine or Tape, I cannot find any documentation on how to make them work and set-up their output to co-operate with Jenkins.

Can anyone point me to a documentation for Jasmine, Tape and other unit test frameworks, explaining on how to configure them properly to be triggered and evaluated by Jenkins?

demouser123
  • 4,108
  • 9
  • 50
  • 82
AxD
  • 2,714
  • 3
  • 31
  • 53

1 Answers1

0

There is nothing special to do with regards to Jenkins. You need to install the testing libraries as you normally would on the Jenkins executor nodes, and then you can use them as you normally use them from within your Jenkins job. Note that this may mean calling npm install from within your Jenkins job - this is pretty typical; you would do something similar whether you were using Python virtualenv, Ruby bundler, etc.

jayhendren
  • 4,286
  • 2
  • 35
  • 59
  • I don't get it. Jenkins requires unit test output in JUnit format. That's not the common output of these unit test frameworks, I presume. Why would I need to call npm install from within my Jenkins job? Isn't is setup in devDependencies already, so the build will install the unit test framework? – AxD Jun 26 '18 at 12:58
  • Typically you just write your Jenkins job to shell out to whatever testing framework you want. – jayhendren Jun 26 '18 at 16:11
  • Nay, if you'd do that you woudn't require Jenkins at all. Any file watcher could to the job then. – AxD Jun 30 '18 at 23:06