Skip to content

Commit

Permalink
End of day commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
kalinchernev committed Sep 17, 2016
1 parent ff58ba0 commit 5c55c1e
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/fixtures/swaggerObject.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"info":{
"title":"Hello World",
"version":"1.0.0",
"description":"A sample API"
},
"host":"localhost:3000",
"basePath":"/",
"swagger":"2.0",
"paths":{

},
"definitions":{

},
"responses":{

},
"parameters":{

},
"securityDefinitions":{

},
"tags":[

]
}
8 changes: 8 additions & 0 deletions test/fixtures/testData.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions test/swagger-helpers-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
var swaggerHelpers = require('../lib/swagger-helpers');
var chai = require('chai');
var expect = chai.expect;
var swaggerObject = require('./fixtures/swaggerObject.json');
var testData = require('./fixtures/testData');

describe('swagger-helpers submodule', function () {

Expand All @@ -21,6 +23,11 @@ describe('swagger-helpers submodule', function () {
done();
});

it('addDataToSwaggerObject() handles tags "tags" field', function(done) {
swaggerHelpers.addDataToSwaggerObject(swaggerObject, testData.tags);
done();
});

it('should have a method swaggerizeObj()', function (done) {
expect(swaggerHelpers).to.include.keys('swaggerizeObj');
expect(swaggerHelpers.swaggerizeObj).to.be.function;
Expand Down

0 comments on commit 5c55c1e

Please sign in to comment.