From bf31d6d5fa4758739fb11c4b0ab269684ce94f98 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 13 Apr 2016 17:41:23 +0100 Subject: [PATCH] Karma test tweaks * Make sure we only get one js-sdk (and update runtime config to match) * Don't verifyNoOutstandingRequests (since it is hard to be certain which we will get, and makes the tests too dependent on implementation-specifics). * Disable color for npm test, to avoid confusing Jenkins --- karma.conf.js | 3 +++ package.json | 2 +- test/app-tests/joining.js | 4 ---- webpack.config.js | 3 +++ 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index d2bc92558b..6620ca65b2 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -120,6 +120,9 @@ module.exports = function (config) { // alias any requires to the react module to the one in our path, otherwise // we tend to get the react source included twice when using npm link. react: path.resolve('./node_modules/react'), + + // same goes for js-sdk + "matrix-js-sdk": path.resolve('./node_modules/matrix-js-sdk'), sinon: 'sinon/pkg/sinon.js', }, diff --git a/package.json b/package.json index 51bacdced9..15620b588c 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "start:prod": "parallelshell \"npm run start:js:prod\" \"npm run start:skins:css\" \"http-server -c 1 vector\"", "clean": "rimraf lib vector/bundle.css vector/bundle.js vector/bundle.js.map vector/webpack.css*", "prepublish": "npm run build:css && npm run build:compile", - "test": "karma start --single-run=true --browsers PhantomJS", + "test": "karma start --single-run=true --browsers PhantomJS --colors=false", "test:multi": "karma start" }, "dependencies": { diff --git a/test/app-tests/joining.js b/test/app-tests/joining.js index 0f6cf91b88..1b47889a14 100644 --- a/test/app-tests/joining.js +++ b/test/app-tests/joining.js @@ -65,7 +65,6 @@ describe('joining a room', function () { parentDiv.remove(); parentDiv = null; } - httpBackend.verifyNoOutstandingRequests(); }); it('should not get stuck at a spinner', function(done) { @@ -74,9 +73,6 @@ describe('joining a room', function () { httpBackend.when('PUT', '/presence/'+encodeURIComponent(USER_ID)+'/status') .respond(200, {}); - if (test_utils.browserSupportsWebRTC()) { - httpBackend.when('GET', '/voip/turnServer').respond(200, {}); - } httpBackend.when('GET', '/pushrules').respond(200, {}); httpBackend.when('POST', '/filter').respond(200, { filter_id: 'fid' }); httpBackend.when('GET', '/sync').respond(200, {}); diff --git a/webpack.config.js b/webpack.config.js index 32b7e3e13c..dfe127d6f0 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -42,6 +42,9 @@ module.exports = { // we tend to get the react source included twice when using npm link. react: path.resolve('./node_modules/react'), + // same goes for js-sdk + "matrix-js-sdk": path.resolve('./node_modules/matrix-js-sdk'), + // matrix-js-sdk will use olm if it is available, // but does not explicitly depend on it. Pull it // in from node_modules if it's there.