Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8765021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:10:59+00:00 2026-06-13T16:10:59+00:00

I would like to use unit testing for JavaScript in TeamCity. I am using

  • 0

I would like to use unit testing for JavaScript in TeamCity.

I am using QUnit, and I have seen a couple of places that suggest using phantomjs and QUnitTeamCityDriver. I just have not been able to get it to work…

I don’t have a lot of experience in this, and can’t seem to even get phantomjs to run unit tests in command line.

I literally copied the example from QUnitTeamCityDriver: simple_test.html

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>QUnit Example</title>
  <link rel="stylesheet" href="test_tools/qunit-1.10.0.css">
  <script type="text/javascript" src="resources/jquery-1.8.1.js"></script>
  <script type="text/javascript" src="test_tools/qunit-1.10.0.js"></script>
  <script type="text/javascript" src="qunit_teamcity_driver/QUnitTeamCityDriver.js"></script> 
  <script type="text/javascript" src="tests.js"></script> 
</head>
<body>
  <div id="qunit"></div>
  <h1 id="qunit-header">QUnit example</h1>
  <h2 id="qunit-banner"></h2>
  <div id="qunit-testrunner-toolbar"></div>
  <h2 id="qunit-userAgent"></h2>
  <ol id="qunit-tests"></ol>
  <div id="qunit-fixture">test markup, will be hidden</div>   
</body>
</html>

tests.js has some simple tests that work or not, if I try it with the simple_test.html.

The other referenced files, in the html, are in the respective folders, of course.

phantomjs.exe, tests.js and simple_test.html are in the root of the directory I am calling from.

The directions for TeamCity build are:

Add a "Command Line" Build Step to your build in TeamCity which executes Tests.htm via PhantomJS
Command executable: C:\PhamtomJS\phantomjs.exe
Command parameters: \Scripts\QUnitTeamCityDriver.phantom.js Tests.htm

(which doesn’t work, so I want to test on actual command line before putting in the command line inside TeamCity)

Some things I have tried:

phantomjs.exe tests.js
phantomjs.exe tests.js simple_test.html
phantomjs.exe simple_test.html
phantomjs.exe test_tools\qunit-1.10.0.js tests.js simple_test.html
phantomjs.exe qunit_teamcity_driver/QUnitTeamCityDriver.phantom.js simple_test.html

result: either Parse error or Can’t find variable: test

Please, can someone point me in the right direction, give me an example, tell me what I am doing wrong ? Thank you very much.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T16:11:01+00:00Added an answer on June 13, 2026 at 4:11 pm

    If your technology stack is a match I’ve had success using Chutzpah.

    Among other things it does the heavy lifting for you by dealing with the calls to and from phantomjs described by kabaros, as well as providing TeamCity and Visual Studio integration.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have various methods that I would like to unit test using Visual Studio's
I have 1 unit test method that needs several parameters. I would like to
I'm currently learning unit testing and how to use QUnit and thought that the
I have an array of Integers in Java, I would like use only a
I would like to use D3.js (or maybe Raphaël ) for backend-generated reports using
I've been using MSTest so far for my unit-tests, and found that it would
I would like to automatically generate unit testing report in html format for Android
I am using Kdevelop4, and would like to use a default CMake c++ project.
I would like to introduce unit testing to our C++ product and wanted to
I've never used TDD and unit testing properly, but would like to learn some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.