Skip to content

Commit bf31d6d

Browse files
committed
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
1 parent 181a6a6 commit bf31d6d

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎karma.conf.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ module.exports = function (config) {
120120
// alias any requires to the react module to the one in our path, otherwise
121121
// we tend to get the react source included twice when using npm link.
122122
react: path.resolve('./node_modules/react'),
123+
124+
// same goes for js-sdk
125+
"matrix-js-sdk": path.resolve('./node_modules/matrix-js-sdk'),
123126

124127
sinon: 'sinon/pkg/sinon.js',
125128
},

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"start:prod": "parallelshell \"npm run start:js:prod\" \"npm run start:skins:css\" \"http-server -c 1 vector\"",
2727
"clean": "rimraf lib vector/bundle.css vector/bundle.js vector/bundle.js.map vector/webpack.css*",
2828
"prepublish": "npm run build:css && npm run build:compile",
29-
"test": "karma start --single-run=true --browsers PhantomJS",
29+
"test": "karma start --single-run=true --browsers PhantomJS --colors=false",
3030
"test:multi": "karma start"
3131
},
3232
"dependencies": {

‎test/app-tests/joining.js‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ describe('joining a room', function () {
6565
parentDiv.remove();
6666
parentDiv = null;
6767
}
68-
httpBackend.verifyNoOutstandingRequests();
6968
});
7069

7170
it('should not get stuck at a spinner', function(done) {
@@ -74,9 +73,6 @@ describe('joining a room', function () {
7473

7574
httpBackend.when('PUT', '/presence/'+encodeURIComponent(USER_ID)+'/status')
7675
.respond(200, {});
77-
if (test_utils.browserSupportsWebRTC()) {
78-
httpBackend.when('GET', '/voip/turnServer').respond(200, {});
79-
}
8076
httpBackend.when('GET', '/pushrules').respond(200, {});
8177
httpBackend.when('POST', '/filter').respond(200, { filter_id: 'fid' });
8278
httpBackend.when('GET', '/sync').respond(200, {});

‎webpack.config.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ module.exports = {
4242
// we tend to get the react source included twice when using npm link.
4343
react: path.resolve('./node_modules/react'),
4444

45+
// same goes for js-sdk
46+
"matrix-js-sdk": path.resolve('./node_modules/matrix-js-sdk'),
47+
4548
// matrix-js-sdk will use olm if it is available,
4649
// but does not explicitly depend on it. Pull it
4750
// in from node_modules if it's there.

0 commit comments

Comments
 (0)