1.0.7 • Published 7 years ago

challenge v1.0.7

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

challenge

============

A node.js unit test generator with support for JSON case data

Code Climate Coverage Status Build Status Dependency Status devDependency Status

Examples:

Dynamically generate tests within a Mocha test suite using a JSON array:

Challenge
	.cases(['first', 'second'])
	.test('should generate two tests',
	function(pCase, fDone)
	{
		Expect(pCase)
			.to.be.a('string');

		return fDone();
	});

Or, load JSON data from a file and generate tests for each selected element in an array:

Challenge
	.cases({loadFrom:'case-data.json', range: [0,1]})
	.test('should generate tests from json data',
	function(pCase, fDone)
	{
		Expect(pCase)
			.to.have.property('name');
		Expect(pCase.id.toString())
			.to.equal(pCase.name[pCase.name.length-1]); //id should match last letter of 'name'

		return fDone();
	});

See the unit test for more complex examples, including joining and grouping test case data to generate tests.

1.0.7

7 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago