Skip to content

Commit

Permalink
added test for snippet injection
Browse files Browse the repository at this point in the history
  • Loading branch information
orangewise committed Oct 10, 2016
1 parent 736717b commit db736f6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions test/inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,16 @@ test('openapi is still valid after injection', function (t) {
});
});

test('inject cors into swagger', function (t) {
inject.snippets({ }, { inject: './test/fixtures/inject/*.yaml' }, function (e, injected) {
t.deepEqual(injected, cors, 'noooo');
test('inject cors into empty object', function (t) {
inject.snippets({}, { inject: './test/fixtures/inject/*.yaml' }, function (e, injected) {
t.deepEqual(injected, cors, 'cors is injected into empty object');
t.end();
});
});

test('inject nothing into cors', function (t) {
inject.snippets(cors, {}, function (e, injected) {
t.deepEqual(injected, cors, 'cors is equal to injected');
t.end();
});
});

0 comments on commit db736f6

Please sign in to comment.