From b49818d60e82d7e542ddde2ffacaa3c484bd209c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Thu, 22 Sep 2016 13:35:49 +0200 Subject: [PATCH 1/2] Update deps to loopback 3.0.0 RC --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cf619f9..ee12f74 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "chai": "^3.2.0", "eslint": "^2.8.0", "eslint-config-loopback": "^2.0.0", - "loopback": "^3.0.0-alpha.4", + "loopback": "^3.0.0", "mocha": "^2.2.5", "supertest": "^1.0.1" }, From 6e288a991cf7fac005037daa5711bd7ee88eee37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Thu, 22 Sep 2016 14:42:39 +0200 Subject: [PATCH 2/2] Fix tests to not depend on exact EOL chars Fix the tests to not check for EOL character(s) in the response body, in order to fix tests failing on Windows. --- test/explorer.test.js | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/test/explorer.test.js b/test/explorer.test.js index 3ab55f3..948b811 100644 --- a/test/explorer.test.js +++ b/test/explorer.test.js @@ -144,7 +144,7 @@ describe('explorer', function() { if (err) return done(err); // expect the content of `dummy-swagger-ui/swagger-ui.js` - expect(res.text).to.contain('/* custom swagger-ui file */' + os.EOL); + expect(res.text).to.contain('/* custom swagger-ui file */'); done(); }); @@ -153,9 +153,12 @@ describe('explorer', function() { it('overrides strongloop overrides', function(done) { request(app).get('/explorer/') .expect(200) - // expect the content of `dummy-swagger-ui/index.html` - .expect('custom index.html' + os.EOL) - .end(done); + .end(function(err, res) { + if (err) return done(er); + // expect the content of `dummy-swagger-ui/index.html` + expect(res.text).to.contain('custom index.html'); + done(); + }); }); }); @@ -231,9 +234,12 @@ describe('explorer', function() { request(app).get('/explorer/') .expect(200) - // expect the content of `dummy-swagger-ui/index.html` - .expect('custom index.html' + os.EOL) - .end(done); + .end(function(err, res) { + if (err) return done(err); + // expect the content of `dummy-swagger-ui/index.html` + expect(res.text).to.contain('custom index.html'); + done(); + }); }); it('should allow `uiDirs` to be defined as an String', function(done) { @@ -243,9 +249,12 @@ describe('explorer', function() { request(app).get('/explorer/') .expect(200) - // expect the content of `dummy-swagger-ui/index.html` - .expect('custom index.html' + os.EOL) - .end(done); + .end(function(err, res) { + if (err) return done(err); + // expect the content of `dummy-swagger-ui/index.html` + expect(res.text).to.contain('custom index.html'); + done(); + }); }); });