From e099aa9ce0ced2424f7d01ba249ac69b8eebe5ba Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 28 Mar 2016 17:24:27 +0100 Subject: [PATCH 01/13] test component index and stub component --- test/components/stub-component.js | 11 +++++++++++ test/test-component-index.js | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 test/components/stub-component.js create mode 100644 test/test-component-index.js diff --git a/test/components/stub-component.js b/test/components/stub-component.js new file mode 100644 index 0000000000..8882a0b35d --- /dev/null +++ b/test/components/stub-component.js @@ -0,0 +1,11 @@ +/* A dummy React component which we use for stubbing out app-level components + */ +'use strict'; + +var React = require('react'); + +module.exports = React.createClass({ + render: function() { + return
; + }, +}); diff --git a/test/test-component-index.js b/test/test-component-index.js new file mode 100644 index 0000000000..9b5c07af54 --- /dev/null +++ b/test/test-component-index.js @@ -0,0 +1,18 @@ +/* + * test-component-index.js + * + * Stub out a bunch of the components which we expect the application to + * provide + */ +var components = require('../src/component-index.js').components; +var stub = require('./components/stub-component.js'); + +components['structures.LeftPanel'] = stub; +components['structures.RightPanel'] = stub; +components['structures.RoomDirectory'] = stub; +components['views.globals.MatrixToolbar'] = stub; +components['views.globals.GuestWarningBar'] = stub; +components['views.globals.NewVersionBar'] = stub; +components['views.elements.Spinner'] = stub; + +module.exports.components = components; From f60dd93660449413244d19311c522718a7015f6f Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 24 Mar 2016 22:59:01 +0000 Subject: [PATCH 02/13] Initial implementation of some karma/mocha tests It does something, but things I don't like: * it churns for 15 seconds webpacking everything. Do we really need to get webpack involved here? * I don't think there's any way to control which tests get run and which don't. Other things I'd want to fix up include: * Make it run on jsdom or phantomjs instead of Chrome * figure out how to configure babel without a .babelrc --- .babelrc | 3 ++ karma.conf.js | 39 +++++++++++++++++++ package.json | 15 ++++++- .../components/structures/MatrixChat-test.js | 11 ++++++ tests/tests.js | 11 ++++++ 5 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 .babelrc create mode 100644 karma.conf.js create mode 100644 tests/components/structures/MatrixChat-test.js create mode 100644 tests/tests.js diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000000..0578679419 --- /dev/null +++ b/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["react", "es2015"] +} diff --git a/karma.conf.js b/karma.conf.js new file mode 100644 index 0000000000..a859e34edb --- /dev/null +++ b/karma.conf.js @@ -0,0 +1,39 @@ +// karma.conf.js +var webpack = require('webpack'); +var path = require('path'); + +module.exports = function (config) { + config.set({ + browsers: ['Chrome'], + singleRun: true, + frameworks: ['mocha'], + files: [ + 'tests/tests.js' + ], + preprocessors: { + 'tests/tests.js': ['webpack', 'sourcemap'] + }, + reporters: ['dots'], + webpack: { + module: { + loaders: [ + { test: /\.json$/, loader: "json" }, + { test: /\.js$/, loader: "babel", include: path.resolve('./src') }, + ], + noParse: [ + // don't parse the languages within highlight.js. They + // cause stack overflows + // (https://github.com/webpack/webpack/issues/1721), and + // there is no need for webpack to parse them - they can + // just be included as-is. + /highlight\.js\/lib\/languages/, + ], + }, + resolve: { + alias: { + 'matrix-react-sdk': path.resolve('src/index.js'), + }, + }, + }, + }); +}; diff --git a/package.json b/package.json index d2e9c32d74..60ff7f7b05 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,9 @@ "build": "babel src -d lib --source-maps", "start": "babel src -w -d lib --source-maps", "clean": "rimraf lib", - "prepublish": "npm run build; git rev-parse HEAD > git-revision.txt" + "prepublish": "npm run build; git rev-parse HEAD > git-revision.txt", + "test": "karma start", + "test-multi": "karma start --single-run=false" }, "dependencies": { "classnames": "^2.1.2", @@ -45,6 +47,15 @@ "json-loader": "^0.5.3", "require-json": "0.0.1", "rimraf": "^2.4.3", - "source-map-loader": "^0.1.5" + "source-map-loader": "^0.1.5", + + "karma": "^0.0.0", + "karma-cli": "^0.0.0", + "karma-mocha": "^0.0.0", + "karma-webpack": "^0.0.0", + "karma-sourcemap-loader": "^0.0.0", + "karma-chrome-launcher": "^0.0.0", + "mocha": "^0.0.0", + "expect": "^0.0.0" } } diff --git a/tests/components/structures/MatrixChat-test.js b/tests/components/structures/MatrixChat-test.js new file mode 100644 index 0000000000..917dbcba18 --- /dev/null +++ b/tests/components/structures/MatrixChat-test.js @@ -0,0 +1,11 @@ +var React = require('react'); +var expect = require('expect'); + +var sdk = require("matrix-react-sdk"); + +var MatrixChat = sdk.getComponent('structures.MatrixChat'); + +describe('MatrixChat', function () { + it('does something', function () { + }); +}); diff --git a/tests/tests.js b/tests/tests.js new file mode 100644 index 0000000000..5a2a44909b --- /dev/null +++ b/tests/tests.js @@ -0,0 +1,11 @@ +// tests.js +// +// Our master test file: uses the webpack require API to find our test files +// and run them + +// this is a handly place to make sure the sdk has been skinned +var sdk = require("matrix-react-sdk"); +sdk.loadSkin(require('../src/component-index')); + +var context = require.context('.', true, /-test\.jsx?$/); +context.keys().forEach(context); From d7801ef3a41b6d26f41aaf1bd930f0686ac3e792 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 28 Mar 2016 17:36:22 +0100 Subject: [PATCH 03/13] Vaguely working webpack test --- karma.conf.js | 64 +++++++++++++++++-- test/components/structures/MatrixChat-test.js | 22 +++++++ {tests => test}/tests.js | 2 +- .../components/structures/MatrixChat-test.js | 11 ---- 4 files changed, 81 insertions(+), 18 deletions(-) create mode 100644 test/components/structures/MatrixChat-test.js rename {tests => test}/tests.js (86%) delete mode 100644 tests/components/structures/MatrixChat-test.js diff --git a/karma.conf.js b/karma.conf.js index a859e34edb..613930ae45 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -2,23 +2,73 @@ var webpack = require('webpack'); var path = require('path'); +/* + * It's a pain to have to wait for webpack to build everything; however it's + * the easiest way to load our dependencies from node_modules. + */ module.exports = function (config) { config.set({ - browsers: ['Chrome'], - singleRun: true, + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter frameworks: ['mocha'], + + // list of files / patterns to load in the browser files: [ - 'tests/tests.js' + 'test/tests.js' ], + + // preprocess matching files before serving them to the browser + // available preprocessors: + // https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { - 'tests/tests.js': ['webpack', 'sourcemap'] + 'test/tests.js': ['webpack', 'sourcemap'] }, - reporters: ['dots'], + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ['progress'], + + // web server port + port: 9876, + + // enable / disable colors in the output (reporters and logs) + colors: true, + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || + // config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + // enable / disable watching file and executing tests whenever any file + // changes + autoWatch: true, + + // start these browsers + // available browser launchers: + // https://npmjs.org/browse/keyword/karma-launcher + browsers: [ + 'Chrome', + //'PhantomJS', + ], + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: true, + + // Concurrency level + // how many browser should be started simultaneous + concurrency: Infinity, + webpack: { module: { loaders: [ { test: /\.json$/, loader: "json" }, - { test: /\.js$/, loader: "babel", include: path.resolve('./src') }, + { test: /\.js$/, loader: "babel", + include: [path.resolve('./src'), + path.resolve('./test'), + ], + }, ], noParse: [ // don't parse the languages within highlight.js. They @@ -32,6 +82,8 @@ module.exports = function (config) { resolve: { alias: { 'matrix-react-sdk': path.resolve('src/index.js'), + // todo: make this go via an include path? + 'test-component-index': path.resolve('test/test-component-index.js'), }, }, }, diff --git a/test/components/structures/MatrixChat-test.js b/test/components/structures/MatrixChat-test.js new file mode 100644 index 0000000000..4d5c368873 --- /dev/null +++ b/test/components/structures/MatrixChat-test.js @@ -0,0 +1,22 @@ +var React = require('react'); +var TestUtils = require('react-addons-test-utils'); +var expect = require('expect'); + +var sdk = require('matrix-react-sdk'); +var MatrixChat; + +describe('MatrixChat', function () { + before(function() { + MatrixChat = sdk.getComponent('structures.MatrixChat'); + }); + + it('gives a login panel by default', function () { + var res = TestUtils.renderIntoDocument( + + ); + + // we expect a single component + TestUtils.findRenderedComponentWithType( + res, sdk.getComponent('structures.login.Login')); + }); +}); diff --git a/tests/tests.js b/test/tests.js similarity index 86% rename from tests/tests.js rename to test/tests.js index 5a2a44909b..f5b9c36199 100644 --- a/tests/tests.js +++ b/test/tests.js @@ -5,7 +5,7 @@ // this is a handly place to make sure the sdk has been skinned var sdk = require("matrix-react-sdk"); -sdk.loadSkin(require('../src/component-index')); +sdk.loadSkin(require('test-component-index')); var context = require.context('.', true, /-test\.jsx?$/); context.keys().forEach(context); diff --git a/tests/components/structures/MatrixChat-test.js b/tests/components/structures/MatrixChat-test.js deleted file mode 100644 index 917dbcba18..0000000000 --- a/tests/components/structures/MatrixChat-test.js +++ /dev/null @@ -1,11 +0,0 @@ -var React = require('react'); -var expect = require('expect'); - -var sdk = require("matrix-react-sdk"); - -var MatrixChat = sdk.getComponent('structures.MatrixChat'); - -describe('MatrixChat', function () { - it('does something', function () { - }); -}); From c516ecebccbb3fe31116b10a132e6f077bd6de4f Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 28 Mar 2016 17:47:06 +0100 Subject: [PATCH 04/13] No need for .babelrc --- .babelrc | 3 --- karma.conf.js | 9 +++++++++ 2 files changed, 9 insertions(+), 3 deletions(-) delete mode 100644 .babelrc diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 0578679419..0000000000 --- a/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["react", "es2015"] -} diff --git a/karma.conf.js b/karma.conf.js index 613930ae45..52e85f02c3 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -5,6 +5,12 @@ var path = require('path'); /* * It's a pain to have to wait for webpack to build everything; however it's * the easiest way to load our dependencies from node_modules. + * + * TODO: + * - how do we stub out the js-sdk + * - can we run one test at a time + * - can we can we run under phantomjs/jsdom? + * - write junit out */ module.exports = function (config) { config.set({ @@ -68,6 +74,9 @@ module.exports = function (config) { include: [path.resolve('./src'), path.resolve('./test'), ], + query: { + presets: ['react', 'es2015'] + }, }, ], noParse: [ From e428f48269a798b0729795407d94e8b987d20d59 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 28 Mar 2016 18:19:37 +0100 Subject: [PATCH 05/13] Source map working --- karma.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/karma.conf.js b/karma.conf.js index 52e85f02c3..9cf076b1a0 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -91,10 +91,10 @@ module.exports = function (config) { resolve: { alias: { 'matrix-react-sdk': path.resolve('src/index.js'), - // todo: make this go via an include path? 'test-component-index': path.resolve('test/test-component-index.js'), }, }, + devtool: 'inline-source-map', }, }); }; From 7e1e2347b5d068cd9771687da6ff0de66ff8c957 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 28 Mar 2016 18:22:07 +0100 Subject: [PATCH 06/13] Don't need alias for test-component-index --- karma.conf.js | 1 - test/tests.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index 9cf076b1a0..abd53f6afb 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -91,7 +91,6 @@ module.exports = function (config) { resolve: { alias: { 'matrix-react-sdk': path.resolve('src/index.js'), - 'test-component-index': path.resolve('test/test-component-index.js'), }, }, devtool: 'inline-source-map', diff --git a/test/tests.js b/test/tests.js index f5b9c36199..3eec9ae8ee 100644 --- a/test/tests.js +++ b/test/tests.js @@ -5,7 +5,7 @@ // this is a handly place to make sure the sdk has been skinned var sdk = require("matrix-react-sdk"); -sdk.loadSkin(require('test-component-index')); +sdk.loadSkin(require('./test-component-index')); var context = require.context('.', true, /-test\.jsx?$/); context.keys().forEach(context); From 5f3b82a767537cc07e136f588c1015e5548ebc1d Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 28 Mar 2016 22:59:34 +0100 Subject: [PATCH 07/13] Stub out the matrix client --- karma.conf.js | 33 ++++++++++++----- test/components/structures/MatrixChat-test.js | 9 ++++- test/test-utils.js | 36 +++++++++++++++++++ 3 files changed, 68 insertions(+), 10 deletions(-) create mode 100644 test/test-utils.js diff --git a/karma.conf.js b/karma.conf.js index abd53f6afb..7a866d902d 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -7,7 +7,6 @@ var path = require('path'); * the easiest way to load our dependencies from node_modules. * * TODO: - * - how do we stub out the js-sdk * - can we run one test at a time * - can we can we run under phantomjs/jsdom? * - write junit out @@ -20,7 +19,14 @@ module.exports = function (config) { // list of files / patterns to load in the browser files: [ - 'test/tests.js' + 'test/tests.js', + ], + + // list of files to exclude + // (this doesn't work, and I don't know why - we still rerun the tests + // when lockfiles are created) + exclude: [ + '**/.#*' ], // preprocess matching files before serving them to the browser @@ -70,13 +76,21 @@ module.exports = function (config) { module: { loaders: [ { test: /\.json$/, loader: "json" }, - { test: /\.js$/, loader: "babel", - include: [path.resolve('./src'), - path.resolve('./test'), - ], - query: { - presets: ['react', 'es2015'] - }, + { + // disable 'require' and 'define' for sinon, per + // https://github.com/webpack/webpack/issues/304#issuecomment-170883329 + test: /sinon\/pkg\/sinon\.js/, + // TODO: use 'query'? + loader: 'imports?define=>false,require=>false', + }, + { + test: /\.js$/, loader: "babel", + include: [path.resolve('./src'), + path.resolve('./test'), + ], + query: { + presets: ['react', 'es2015'] + }, }, ], noParse: [ @@ -91,6 +105,7 @@ module.exports = function (config) { resolve: { alias: { 'matrix-react-sdk': path.resolve('src/index.js'), + 'sinon': 'sinon/pkg/sinon.js', }, }, devtool: 'inline-source-map', diff --git a/test/components/structures/MatrixChat-test.js b/test/components/structures/MatrixChat-test.js index 4d5c368873..46c76bb007 100644 --- a/test/components/structures/MatrixChat-test.js +++ b/test/components/structures/MatrixChat-test.js @@ -3,14 +3,21 @@ var TestUtils = require('react-addons-test-utils'); var expect = require('expect'); var sdk = require('matrix-react-sdk'); -var MatrixChat; + +var test_utils = require('../../test-utils'); +var peg = require('../../../src/MatrixClientPeg.js'); +var q = require('q'); describe('MatrixChat', function () { + var MatrixChat; before(function() { + test_utils.stubClient(); MatrixChat = sdk.getComponent('structures.MatrixChat'); }); it('gives a login panel by default', function () { + peg.get().loginFlows.returns(q({})); + var res = TestUtils.renderIntoDocument( ); diff --git a/test/test-utils.js b/test/test-utils.js new file mode 100644 index 0000000000..7c0f38693a --- /dev/null +++ b/test/test-utils.js @@ -0,0 +1,36 @@ +"use strict"; + +var peg = require('../src/MatrixClientPeg.js'); +var jssdk = require('matrix-js-sdk'); +var sinon = require('sinon'); + +/** + * Stub out the MatrixClient, and configure the MatrixClientPeg object to + * return it when get() is called. + */ +module.exports.stubClient = function() { + var pegstub = sinon.stub(peg); + + var matrixClientStub = sinon.createStubInstance(jssdk.MatrixClient); + pegstub.get.returns(matrixClientStub); +} + + +/** + * make the test fail, with the given exception + * + *

This is useful for use with integration tests which use asyncronous + * methods: it can be added as a 'catch' handler in a promise chain. + * + * @param {Error} error exception to be reported + * + * @example + * it("should not throw", function(done) { + * asynchronousMethod().then(function() { + * // some tests + * }).catch(utils.failTest).done(done); + * }); + */ +module.exports.failTest = function(error) { + expect(error.stack).toBe(null); +}; From 04561ea6e68a383b837b75dc8e41ceb917e67fda Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 28 Mar 2016 23:29:49 +0100 Subject: [PATCH 08/13] Use phantomjs when running a single test --- karma.conf.js | 12 ++++++++---- package.json | 23 ++++++++++++----------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index 7a866d902d..4604e1355a 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,16 +1,20 @@ -// karma.conf.js +// karma.conf.js - the config file for karma, which runs our tests. + var webpack = require('webpack'); var path = require('path'); /* - * It's a pain to have to wait for webpack to build everything; however it's - * the easiest way to load our dependencies from node_modules. + * We use webpack to build our tests. It's a pain to have to wait for webpack + * to build everything; however it's the easiest way to load our dependencies + * from node_modules. * * TODO: * - can we run one test at a time - * - can we can we run under phantomjs/jsdom? * - write junit out */ + +process.env.PHANTOMJS_BIN = 'node_modules/.bin/phantomjs'; + module.exports = function (config) { config.set({ // frameworks to use diff --git a/package.json b/package.json index 60ff7f7b05..186ed6681e 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "start": "babel src -w -d lib --source-maps", "clean": "rimraf lib", "prepublish": "npm run build; git rev-parse HEAD > git-revision.txt", - "test": "karma start", + "test": "karma start --browsers PhantomJS", "test-multi": "karma start --single-run=false" }, "dependencies": { @@ -44,18 +44,19 @@ "//depsbuglink": "https://github.com/webpack/webpack/issues/1472", "devDependencies": { "babel": "^5.8.23", + "expect": "^1.16.0", "json-loader": "^0.5.3", + "karma": "^0.13.22", + "karma-chrome-launcher": "^0.2.3", + "karma-cli": "^0.1.2", + "karma-mocha": "^0.2.2", + "karma-phantomjs-launcher": "^1.0.0", + "karma-sourcemap-loader": "^0.3.7", + "karma-webpack": "^1.7.0", + "mocha": "^2.4.5", + "phantomjs-prebuilt": "^2.1.7", "require-json": "0.0.1", "rimraf": "^2.4.3", - "source-map-loader": "^0.1.5", - - "karma": "^0.0.0", - "karma-cli": "^0.0.0", - "karma-mocha": "^0.0.0", - "karma-webpack": "^0.0.0", - "karma-sourcemap-loader": "^0.0.0", - "karma-chrome-launcher": "^0.0.0", - "mocha": "^0.0.0", - "expect": "^0.0.0" + "source-map-loader": "^0.1.5" } } From 6069812fcf87672dd85f822906e62d1d6acab257 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 28 Mar 2016 23:35:36 +0100 Subject: [PATCH 09/13] Create Junit reports from karma --- .gitignore | 3 +++ karma.conf.js | 9 ++++++--- package.json | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 949e21b82b..8fdaf5903f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ # version file and tarball created by 'npm pack' /git-revision.txt /matrix-react-sdk-*.tgz + +# test reports created by karma +/karma-reports diff --git a/karma.conf.js b/karma.conf.js index 4604e1355a..7a8831635b 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -9,8 +9,7 @@ var path = require('path'); * from node_modules. * * TODO: - * - can we run one test at a time - * - write junit out + * - can we run one test at a time? */ process.env.PHANTOMJS_BIN = 'node_modules/.bin/phantomjs'; @@ -43,7 +42,7 @@ module.exports = function (config) { // test results reporter to use // possible values: 'dots', 'progress' // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['progress'], + reporters: ['progress', 'junit'], // web server port port: 9876, @@ -76,6 +75,10 @@ module.exports = function (config) { // how many browser should be started simultaneous concurrency: Infinity, + junitReporter: { + outputDir: 'karma-reports', + }, + webpack: { module: { loaders: [ diff --git a/package.json b/package.json index 186ed6681e..1f3b2d4962 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "karma": "^0.13.22", "karma-chrome-launcher": "^0.2.3", "karma-cli": "^0.1.2", + "karma-junit-reporter": "^0.4.1", "karma-mocha": "^0.2.2", "karma-phantomjs-launcher": "^1.0.0", "karma-sourcemap-loader": "^0.3.7", From 3f442aca87237746fa7874de72df1be863b1bbc3 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 28 Mar 2016 23:37:00 +0100 Subject: [PATCH 10/13] Run mocha tests on jenkins --- jenkins.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jenkins.sh b/jenkins.sh index a2f28ffb8f..51fab5d020 100755 --- a/jenkins.sh +++ b/jenkins.sh @@ -14,6 +14,9 @@ npm install ./node_modules/matrix-js-sdk-*.tgz # install the other dependencies npm install +# run the mocha tests +npm run test + # delete the old tarball, if it exists rm -f matrix-react-sdk-*.tgz From 31e283729ec78daf0e84cf172ce54eab2733df02 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 28 Mar 2016 23:45:39 +0100 Subject: [PATCH 11/13] Need babel-loader for karma tests --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 1f3b2d4962..6663d0d679 100644 --- a/package.json +++ b/package.json @@ -40,10 +40,9 @@ "velocity-animate": "^1.2.3", "velocity-ui-pack": "^1.2.2" }, - "//deps": "The loader packages are here because webpack in a project that depends on us needs them in this package's node_modules folder", - "//depsbuglink": "https://github.com/webpack/webpack/issues/1472", "devDependencies": { "babel": "^5.8.23", + "babel-loader": "^6.2.4", "expect": "^1.16.0", "json-loader": "^0.5.3", "karma": "^0.13.22", From 9ae3a96b6a502655bef3885e95dc50fc9db1c417 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Tue, 29 Mar 2016 00:02:29 +0100 Subject: [PATCH 12/13] Add missing devDependencies --- package.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 6663d0d679..c26289712c 100644 --- a/package.json +++ b/package.json @@ -42,8 +42,13 @@ }, "devDependencies": { "babel": "^5.8.23", + "babel-core": "^6.7.4", "babel-loader": "^6.2.4", + "babel-preset-es2015": "^6.6.0", + "babel-preset-react": "^6.5.0", + "babel-runtime": "^6.6.1", "expect": "^1.16.0", + "imports-loader": "^0.6.5", "json-loader": "^0.5.3", "karma": "^0.13.22", "karma-chrome-launcher": "^0.2.3", @@ -55,8 +60,11 @@ "karma-webpack": "^1.7.0", "mocha": "^2.4.5", "phantomjs-prebuilt": "^2.1.7", + "react-addons-test-utils": "^0.14.7", "require-json": "0.0.1", "rimraf": "^2.4.3", - "source-map-loader": "^0.1.5" + "sinon": "^1.17.3", + "source-map-loader": "^0.1.5", + "webpack": "^1.12.14" } } From cbcca0bfa102b52da0aeb9b6b3c44198306e52fe Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Tue, 29 Mar 2016 00:02:48 +0100 Subject: [PATCH 13/13] Fix undefined error in test --- test/components/structures/MatrixChat-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/components/structures/MatrixChat-test.js b/test/components/structures/MatrixChat-test.js index 46c76bb007..7d96b3a77a 100644 --- a/test/components/structures/MatrixChat-test.js +++ b/test/components/structures/MatrixChat-test.js @@ -16,7 +16,7 @@ describe('MatrixChat', function () { }); it('gives a login panel by default', function () { - peg.get().loginFlows.returns(q({})); + peg.get().loginFlows.returns(q({flows:[]})); var res = TestUtils.renderIntoDocument(