diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2017-11-12 11:44:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-12 11:44:35 +0300 |
commit | bb6b35c79bfdeb35d7f68f8a73b10fc7cebacaa1 (patch) | |
tree | 7d9e70d52385d9abaf8f12ddec46cf9ab1a10d93 | |
parent | 36528c9e9b49001c6b333f7f9ad283737f96ba72 (diff) | |
parent | ff1e3c75e956660484432d20b62a1b07c4538156 (diff) |
Merge pull request #602 from nextcloud/fix/js-test-execution-config
Fix js tests execution
-rw-r--r-- | js/tests/test-main.js | 3 | ||||
-rw-r--r-- | js/tests/views/composerview_spec.js | 9 | ||||
-rw-r--r-- | js/webpack.base.config.js | 12 | ||||
-rw-r--r-- | karma.conf.js | 5 |
4 files changed, 16 insertions, 13 deletions
diff --git a/js/tests/test-main.js b/js/tests/test-main.js index 3f8a69514..275323dd1 100644 --- a/js/tests/test-main.js +++ b/js/tests/test-main.js @@ -28,6 +28,9 @@ OC = { } }, + filePath: function(app, type, path) { + return type + '/' + path; + }, generateUrl: function(url, params) { var props = []; for (var prop in params) { diff --git a/js/tests/views/composerview_spec.js b/js/tests/views/composerview_spec.js index 1db2f5118..5df466156 100644 --- a/js/tests/views/composerview_spec.js +++ b/js/tests/views/composerview_spec.js @@ -77,6 +77,7 @@ define([ folder: folder, type: 'reply' }); + spyOn(view, 'saveDraft'); expect(view.type).toBe('reply'); expect(view.isReply()).toBe(true); @@ -88,6 +89,7 @@ define([ var view = new ComposerView({ accounts: accounts }); + spyOn(view, 'saveDraft'); expect(view.draftUID).toBeUndefined(); }); @@ -96,6 +98,7 @@ define([ var view = new ComposerView({ accounts: accounts }); + spyOn(view, 'saveDraft'); var expected = [ { @@ -120,6 +123,7 @@ define([ var view = new ComposerView({ accounts: accounts }); + spyOn(view, 'saveDraft'); view.render(); @@ -152,6 +156,7 @@ define([ view = new ComposerView({ accounts: accounts }); + spyOn(view, 'saveDraft'); view.render(); view.bindUIElements(); @@ -249,7 +254,7 @@ define([ view.attachments.add(localAttachmentA); expect(view.checkAllAttachmentsValid()).toBe(false); }); - }), + }); describe('from Files', function () { it('always consider attachments from Files as valid', function() { @@ -263,7 +268,7 @@ define([ view.attachments.add(localAttachmentA); expect(view.checkAllAttachmentsValid()).toBe(true); }); - }) + }); }); }); diff --git a/js/webpack.base.config.js b/js/webpack.base.config.js index d3398effa..320419f21 100644 --- a/js/webpack.base.config.js +++ b/js/webpack.base.config.js @@ -6,6 +6,12 @@ module.exports = { filename: 'build.js', path: path.resolve(__dirname, 'build') }, + resolve: { + modules: [path.resolve(__dirname), 'node_modules'], + alias: { + 'handlebars': 'handlebars/runtime.js' + } + }, module: { rules: [ {test: /davclient/, use: 'exports-loader?dav'}, @@ -19,11 +25,5 @@ module.exports = { loaders: [ {test: /ical/, loader: 'exports-loader?ICAL'} ] - }, - resolve: { - modules: [path.resolve(__dirname), 'node_modules'], - alias: { - 'handlebars': 'handlebars/runtime.js' - } } }; diff --git a/karma.conf.js b/karma.conf.js index ac73e20ce..eb9b5e854 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -19,9 +19,6 @@ module.exports = function (config) { {pattern: 'node_modules/jquery/dist/jquery.js', included: true}, {pattern: 'node_modules/underscore/underscore.js', included: true}, {pattern: 'js/tests/test-main.js', included: true}, - //{pattern: 'js/**/*.js', included: false}, - //{pattern: 'js/*.js', included: false}, - //{pattern: 'js/templates/*.html', included: false}, // all files ending in "_test" {pattern: 'js/tests/*_spec.js', watched: false}, {pattern: 'js/tests/**/*_spec.js', watched: false}, @@ -36,12 +33,10 @@ module.exports = function (config) { // preprocess matching files before serving them to the browser // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { - //'js/build/build.js': ['webpack'], 'js/**[!vendor]/*[!spec].js': ['coverage'], // add webpack as preprocessor 'js/tests/*_spec.js': ['webpack'], 'js/tests/**/*_spec.js': ['webpack'] - //'js/build/build.js': ['webpack', 'sourcemap'] }, webpackMiddleware: { |