/grunt-amd-test

Generating failing unit tests and running unit tests for AMD-based projects

Primary LanguageJavaScriptMIT LicenseMIT

grunt-amd-test

Generates test runners for AMD-based projects, and that's it! Does not generate failing test cases or run tests. You can use the following projects to run the test runners generated by grunt-amd-test:

For QUnit: grunt-contrib-qunit For jasmine: grunt-contrib-jasmine (my fork, stripped down to be only a runner)

This plugin requires Grunt ~0.4.0

Installation

From the same directory as your Gruntfile, run

npm install grunt-amd-test

Then add the following line to your Gruntfile:

grunt.loadNpmTasks('grunt-amd-test');

You can verify that the task is available by running grunt --help and checking that "amd-test" is present under "Available tasks".

Usage

grunt-amd-test reads two sections of your config: amd-test and requirejs. amd-test can contain these properties:

'amd-test': {
	//generate a qunit runner.html or a jasmine runner.html
	mode: 'qunit',
	//mode: 'jasmine',

	//Grunt files configuration object containing all unit tests to be included
	//(more: http://gruntjs.com/configuring-tasks)
	files: 'test/unit/*.js'
},

requirejs is a standard r.js configuration object. grunt-amd-test uses baseUrl, paths, and packages (all optional) to transform file names to AMD module names.

Once these options are in place, grunt amd-test will run amd-test.

License

Released under the MIT License.