Skip to content

Commit

Permalink
Merge pull request video-dev#1767 from video-dev/unit-tests-sourcemaps
Browse files Browse the repository at this point in the history
Improve unit tests sourcemaps
  • Loading branch information
tchakabam authored Jun 8, 2018
2 parents 6a5695f + 224254a commit 7cd8d7d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
8 changes: 5 additions & 3 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ module.exports = function(config) {
frameworks: ['mocha', 'sinon', 'should'],

// list of files / patterns to load in the browser
files: ['tests/tests.webpack.js'],
files: [
'tests/unit/**/*.js'
],

// list of files to exclude
exclude: [],

// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'tests/tests.webpack.js': ['webpack', 'sourcemap']
'**/*.js': ['webpack', 'sourcemap']
},

// test results reporter to use
Expand All @@ -37,7 +39,7 @@ module.exports = function(config) {
},

webpack: {
devtool: 'inline-source-map',
devtool: 'eval',
module: {
rules: [
// instrument only testing sources with Istanbul
Expand Down
2 changes: 2 additions & 0 deletions tests/mocks/hls.mock.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Hls from '../../src/hls';

const sinon = require('sinon');

/**
* All public methods of Hls instance
*/
Expand Down
7 changes: 0 additions & 7 deletions tests/tests.webpack.js

This file was deleted.

5 changes: 4 additions & 1 deletion tests/unit/controller/eme-controller.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import EMEController from '../../../src/controller/eme-controller';
import assert from 'assert';
import HlsMock from '../../mocks/hls.mock';
import EventEmitter from 'events';
import { ErrorTypes, ErrorDetails } from '../../../src/errors';

const sinon = require('sinon');

import assert from 'assert';

const MediaMock = function () {
let media = new EventEmitter();
media.setMediaKeys = sinon.spy();
Expand Down

0 comments on commit 7cd8d7d

Please sign in to comment.