Home

Awesome

spritesmith-engine-test Build Status

Common test suite for spritesmith engines

These files were written for usage with mocha

Specification version

The current repository version is built to match specification version:

2.0.0

Specification documentation can be found at:

https://github.com/twolfson/spritesmith-engine-spec/tree/2.0.0

Getting started

Install the module via: npm install spritesmith-engine-test

Create files that require and run the test suite:

test/myengine_test.js:

// Load in dependencies
var spritesmithEngineTest = require('spritesmith-engine-test');
var MyEngine = require('../lib/engine');

// Run our test suite
// DEV: This loads and define multiple `mocha` test suites
spritesmithEngineTest.run({
  engine: MyEngine,
  engineName: 'myengine'
});

Run your tests via mocha:

# Install test dependencies
npm install mocha

# Run mocha test suite
./node_modules/.bin/mocha test/
#  myengine
#    interpretting an image file
#      ✓ gathers statistics on an image file
#  ...

Documentation

spritesmith-engine-test exports the following keys its module.exports:

run(params)

Generates a set of mocha test suites for a spritesmith engine

Example with tests:

spritesmithEngineTest.run({
  engine: myengine,
  engineName: 'myengine',
  // Skip over rendering a GIF image
  tests: {
    renderGifCanvas: false
  }
});

Tests

Our test suite has the following tests built into it:

Donating

Support this project and others by twolfson via donations.

http://twolfson.com/support-me

License

Copyright (c) 2013-2014 Todd Wolfson

Licensed under the MIT license.