Browserify and webpack tests (#844)
* Browserify and webpack tests * added tests
Showing
5 changed files
with
34 additions
and
4 deletions
... | @@ -19,7 +19,9 @@ | ... | @@ -19,7 +19,9 @@ |
19 | "build:js:browserify": "browserify . -s videojs-contrib-hls -g browserify-shim -o dist/videojs-contrib-hls.js", | 19 | "build:js:browserify": "browserify . -s videojs-contrib-hls -g browserify-shim -o dist/videojs-contrib-hls.js", |
20 | "build:js:collapse": "bundle-collapser dist/videojs-contrib-hls.js -o dist/videojs-contrib-hls.min.js", | 20 | "build:js:collapse": "bundle-collapser dist/videojs-contrib-hls.js -o dist/videojs-contrib-hls.min.js", |
21 | "build:js:uglify": "uglifyjs dist/videojs-contrib-hls.min.js --comments -m -c -o dist/videojs-contrib-hls.min.js", | 21 | "build:js:uglify": "uglifyjs dist/videojs-contrib-hls.min.js --comments -m -c -o dist/videojs-contrib-hls.min.js", |
22 | "build:test": "npm-run-all build:test:manifest build:test:js", | 22 | "build:test:browserify": "browserify test/browserify-test.js -o dist-test/browserify-test.js", |
23 | "build:test:webpack": "webpack test/webpack-test.js dist-test/webpack-test.js", | ||
24 | "build:test": "npm-run-all build:test:manifest build:test:js build:test:browserify build:test:webpack", | ||
23 | "build:test:js": "node scripts/build-test.js", | 25 | "build:test:js": "node scripts/build-test.js", |
24 | "build:test:manifest": "node -e \"var b=require('./scripts/manifest-data.js'); b.build();\"", | 26 | "build:test:manifest": "node -e \"var b=require('./scripts/manifest-data.js'); b.build();\"", |
25 | "clean": "npm-run-all -p clean:*", | 27 | "clean": "npm-run-all -p clean:*", |
... | @@ -45,7 +47,9 @@ | ... | @@ -45,7 +47,9 @@ |
45 | "watch:js:babel": "npm run build:js:babel -- --watch", | 47 | "watch:js:babel": "npm run build:js:babel -- --watch", |
46 | "watch:js:browserify": "watchify . -v -g browserify-shim -o dist/videojs-contrib-hls.js", | 48 | "watch:js:browserify": "watchify . -v -g browserify-shim -o dist/videojs-contrib-hls.js", |
47 | "watch:js:switcher": "watchify utils/switcher/switcher.js -v -t babelify -g browserify-shim -o dist/switcher.js", | 49 | "watch:js:switcher": "watchify utils/switcher/switcher.js -v -t babelify -g browserify-shim -o dist/switcher.js", |
48 | "watch:test": "npm-run-all -p watch:test:*", | 50 | "watch:test:browserify": "watchify test/browserify-test.js -o dist-test/browserify-test.js", |
51 | "watch:test:webpack": "watchify test/webpack-test.js -o dist-test/webpack-test.js", | ||
52 | "watch:test": "npm-run-all -p watch:test:js watch:test:webpack watch:test:browserify", | ||
49 | "watch:test:js": "node scripts/watch-test.js", | 53 | "watch:test:js": "node scripts/watch-test.js", |
50 | "watch:test:manifest": "node -e \"var b=require('./scripts/manifest-data.js'); b.watch();\"", | 54 | "watch:test:manifest": "node -e \"var b=require('./scripts/manifest-data.js'); b.watch();\"", |
51 | "prepublish": "npm run build" | 55 | "prepublish": "npm run build" |
... | @@ -125,6 +129,7 @@ | ... | @@ -125,6 +129,7 @@ |
125 | "sinon": "1.10.2", | 129 | "sinon": "1.10.2", |
126 | "uglify-js": "^2.5.0", | 130 | "uglify-js": "^2.5.0", |
127 | "videojs-standard": "^4.0.3", | 131 | "videojs-standard": "^4.0.3", |
128 | "watchify": "^3.6.0" | 132 | "watchify": "^3.6.0", |
133 | "webpack": "^1.13.2" | ||
129 | } | 134 | } |
130 | } | 135 | } | ... | ... |
test/browserify-test.js
0 → 100644
1 | /* eslint-disable no-var */ | ||
2 | /* eslint-env qunit */ | ||
3 | var hls = require('../es5/videojs-contrib-hls.js'); | ||
4 | var q = window.QUnit; | ||
5 | |||
6 | q.module('Browserify Require'); | ||
7 | q.test('hls should be requirable and bundled via browserify', function(assert) { | ||
8 | assert.ok(hls, 'videoj-contrib-hls is required properly'); | ||
9 | }); |
... | @@ -12,6 +12,8 @@ | ... | @@ -12,6 +12,8 @@ |
12 | <!-- NOTE in order for test to pass we require sinon 1.10.2 exactly --> | 12 | <!-- NOTE in order for test to pass we require sinon 1.10.2 exactly --> |
13 | <script src="/node_modules/sinon/pkg/sinon.js"></script> | 13 | <script src="/node_modules/sinon/pkg/sinon.js"></script> |
14 | <script src="/node_modules/qunitjs/qunit/qunit.js"></script> | 14 | <script src="/node_modules/qunitjs/qunit/qunit.js"></script> |
15 | <script src="/dist-test/browserify-test.js"></script> | ||
16 | <script src="/dist-test/webpack-test.js"></script> | ||
15 | <script src="/node_modules/video.js/dist/video.js"></script> | 17 | <script src="/node_modules/video.js/dist/video.js"></script> |
16 | <script src="/dist-test/videojs-contrib-hls.js"></script> | 18 | <script src="/dist-test/videojs-contrib-hls.js"></script> |
17 | 19 | ... | ... |
... | @@ -10,7 +10,9 @@ var DEFAULTS = { | ... | @@ -10,7 +10,9 @@ var DEFAULTS = { |
10 | 'node_modules/sinon/pkg/sinon-ie.js', | 10 | 'node_modules/sinon/pkg/sinon-ie.js', |
11 | 'node_modules/video.js/dist/video.js', | 11 | 'node_modules/video.js/dist/video.js', |
12 | 'node_modules/video.js/dist/video-js.css', | 12 | 'node_modules/video.js/dist/video-js.css', |
13 | 'test/**/*.test.js' | 13 | 'test/**/*.test.js', |
14 | 'dist-test/browserify-test.js', | ||
15 | 'dist-test/webpack-test.js' | ||
14 | ], | 16 | ], |
15 | 17 | ||
16 | exclude: [], | 18 | exclude: [], |
... | @@ -20,6 +22,11 @@ var DEFAULTS = { | ... | @@ -20,6 +22,11 @@ var DEFAULTS = { |
20 | 'karma-qunit' | 22 | 'karma-qunit' |
21 | ], | 23 | ], |
22 | 24 | ||
25 | browserConsoleLogOptions: { | ||
26 | level: 'error', | ||
27 | terminal: false | ||
28 | }, | ||
29 | |||
23 | preprocessors: { | 30 | preprocessors: { |
24 | 'test/**/*.test.js': ['browserify'] | 31 | 'test/**/*.test.js': ['browserify'] |
25 | }, | 32 | }, | ... | ... |
-
Please register or sign in to post a comment