formatting

This commit is contained in:
Tony Tam
2015-01-30 22:57:57 -08:00
parent 6bbbc4ab31
commit 2a7b829ee5
2 changed files with 16 additions and 40 deletions

View File

@@ -28,25 +28,16 @@ describe('swagger 2.0 spec tests', function (done) {
var swaggerUI, specServer, driver;
before(function () {
swaggerUI = createServer({
root: dist,
headers: headers
});
specServer = createServer({
root: specs,
headers: headers
});
swaggerUI = createServer({ root: dist, headers: headers });
specServer = createServer({ root: specs, headers: headers });
driver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.firefox()).build();
swaggerUI.listen(DOCS_PORT);
specServer.listen(SPEC_SERVER_PORT);
driver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.firefox()).
build();
var encoded = encodeURIComponent('http://localhost:' + SPEC_SERVER_PORT + '/v2/petstore.json')
driver.get('http://localhost:' + DOCS_PORT + '/index.html?url=' + encoded);
var swaggerSpecLocation = encodeURIComponent('http://localhost:' + SPEC_SERVER_PORT + '/v2/petstore.json')
driver.get('http://localhost:' + DOCS_PORT + '/index.html?url=' + swaggerSpecLocation);
});
afterEach(function(){
@@ -55,12 +46,9 @@ describe('swagger 2.0 spec tests', function (done) {
var errors = [];
browserLogs.forEach(function(log){
// 900 and above is "error" level. Console should not have any errors
if (log.level.value > 900) {
console.log('browser error message:', log.message);
errors.push(log);
}
if (log.level.value > 900)
console.log('browser error message:', log.message); errors.push(log);
});
expect(errors).to.be.empty;
done();
});