Skip to content

A functional testing suite for Bulkhead services. Comes with Sails lifting, Barrels for fixtures, and Supertest for REST testing built in.

License

Notifications You must be signed in to change notification settings

CodeOtter/bulkhead-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bulkhead-test

A functional testing suite for Bulkhead services. This package uses:

Quick start

npm install bulkhead-test

Configuration

  • All tests need to be in JavaScript and in a folder called test in the package root with a .js extension.
  • All fixtures need to be in JSON format and in a folder called test/fixtures in the package root with a .json extension. (See Barrels for more details)
  • All fixture names need to be consisting of the package name, an underscore, and the model name in lower case. (Example: If your package is called testPackage and your model is called Account.js, the fixture needs to be called testPackage_account.json)
  • You will need to lift the sails application before tests are ran. This can be done with the following:
var suite = require('bulkhead-test');
  
describe('A test category', function() {

  suite.lift();  // You lift sails during in your suite description

  describe('Some test', function() {
  	it('should test', function(done) {
      /* ... */
      done();
  });
});

To perform REST tests against the application, do the following:

var suite = require('bulkhead-test');
  
describe('A test category', function() {
  suite.lift();
  describe('A category breakdown', function() {
    it('should do REST testing', function(done) {
      // Using suite.rest() will allow you to utilize the Supertest API
      suite.rest()
        .get('/')
        .end(function(err, res) {
          done();
        }
      );
    })
  });
});

For more help with REST testing, check out supertest.

About

A functional testing suite for Bulkhead services. Comes with Sails lifting, Barrels for fixtures, and Supertest for REST testing built in.

Resources

License

Stars

Watchers

Forks

Packages

No packages published