1

I need to run JS tests on CI server. Testing framework is mocha. I've found mocha-phantomjs but it gives me output like this:

ReferenceError: Can't find variable: require at c:/w1/-----/---/Tests/RestApiTests/BasicTests.js:1

When I changed reporter to 'teamcity' the output was like this:

The Teamcity reporter was moved to a package named mocha-teamcity-reporter (https://npmjs.org/package/mocha-teamcity-reporter). Unable to open file 'teamcity'

And no instructions the way I can use it.

I have two *.js files with tests, which has to be tested on CI server, with report of amount of tests passed/failed

Pretty new to JS, as well as to testing it, but I need to configure this tests in TeamCity, to have results on failed and passed tests.

gfullam
  • 11,531
  • 5
  • 50
  • 64
  • This sounds like a CommonJS modules problem. From [`mocha-phantomjs` github issues](https://github.com/nathanboktae/mocha-phantomjs/issues/80): "The tests here are run within the browser which does not natively support modules. If you want to use a module pattern you will need to use a system like AMD or Browserify to support these within the browser context." – gfullam Sep 09 '16 at 13:10

0 Answers0