Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time



js++Unit is an xUnit unit testing framework for writing and running automated tests using the JS++ programming language.

The library features a very concise and familiar syntax. js++Unit was inspired by the Mocha test framework for JavaScript and other xUnit frameworks.

Getting Started

Download the ConsoleStyle library, which js++Unit depends on.

In your editor, create a test.jspp:

import Vendor.JSPPUnit;
import Vendor.JSPPUnit.Assert;

suite("Math", void() {
	test("plus", void() {
		equal( 1 + 1 , 2 );

In your terminal:

$ js++ test.jspp path/to/jsppUnit/src/ path/to/ConsoleStyle/src/

You need to link the js++Unit library and the ConsoleStyle library (which js++Unit depends on) in order to successfully compile. The best practice is to use the src folder for the libraries rather than the libraries' root directories; otherwise, there may be tests and other unwanted files fed into the compiler, and the compiler will complain there is more than one main file.

The compiler should have generated an app.jspp.js file. Run it (e.g. with Node.js) and you should see the test output:

$ node app.jspp.js

    ✔ plus

  1 passing (1ms)


Since JS++ only allows one "main file", it is highly recommended you define your test suites using modules:

module Vendor.MyCompany.MyApp.Tests.Tests1
	public void queue() {
		suite("My test suite", void() {
			/* ... */

You can then execute all of your modularized tests by importing them into the main file and calling

import Vendor.JSPPUnit;
import Vendor.MyCompany.MyApp.Tests.Tests1;
import Vendor.MyCompany.MyApp.Tests.Tests2;


Web Browser Output

js++Unit supports web browser output if executed inside a web browser. Simply include the compiled .jspp.js file for your tests:

<!DOCTYPE html>
<title>js++Unit Web Browser</title>
<script type="text/javascript" src="../path/to/tests_main_file.jspp.js"></script>


MIT License