steal-mocha

  • module
{mocha}  

steal-mocha will automatically run your tests once all tests are loaded.

mocha

Calls mocha.setup() with the provided mocha config. Waits for steal.done, at which time all tests will have been loaded, and then calls mocha.run() which will run the tests.

Returns the mocha object.

Use

Add the Steal tag to your page

<script src="node_modules/steal/steal.js"
  mocha="bdd"></script>

This will do the equivalent of

mocha.setup("bdd");

and your tests will automatically be ran.

Writing tests

When you write tests just be sure to import steal-mocha.

import "steal-mocha";

describe("Foo", function(){
  it("bar", function(){
    assert("yay!");
  });
});
Help us improve StealJS by taking our community survey