Skip to content

Commit

Permalink
test(express): cover Express middleware with tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gergelyke authored and Peter Marton committed Jul 27, 2015
1 parent 4349a48 commit 8dc7282
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion src/express/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,36 @@ describe('graffiti express', function() {

var express = require('./');

it('checks for required options');
describe('checks for required options', function() {

it('throws an error if not all met', function() {

try {
express({
prefix: '/graphql'
});
} catch (ex) {
expect(ex).to.be.ok;
return;
}

throw new Error('Error should have been thrown');

});

it('doesn\'t throw if all is passed', function() {

var mw = express({
prefix: '/graphql',
models: [],
adapter: {
getSchema: function() {}
}
});

expect(mw).to.be.ok;
});
});

it('creates the schema');

Expand Down

0 comments on commit 8dc7282

Please sign in to comment.