Skip to content

Commit

Permalink
Merge pull request video-dev#2073 from itsjamie/buffer-controller-ts
Browse files Browse the repository at this point in the history
Buffer Controller TypeScript
  • Loading branch information
michaelcunningham19 authored Jan 22, 2019
2 parents 88a084b + ea3e1f0 commit e2e480f
Show file tree
Hide file tree
Showing 9 changed files with 462 additions and 289 deletions.
129 changes: 69 additions & 60 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,65 @@ const webpack = require('webpack');
const path = require('path');

module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',

// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['mocha', 'sinon', 'should'],
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['mocha', 'sinon', 'should'],

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

// list of files to exclude
exclude: [],
// 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: {
'**/*.js': ['webpack', 'sourcemap']
},
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'tests/**/*.js': ['webpack', 'sourcemap']
},

// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['mocha', 'coverage-istanbul'],
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['mocha', 'coverage-istanbul'],

coverageIstanbulReporter: {
reports: ['lcov', 'text-summary'],
fixWebpackSourcePaths: true
},
coverageIstanbulReporter: {
reports: ['lcov', 'text-summary'],
fixWebpackSourcePaths: true
},

webpack: {
webpack: {
mode: 'development',
devtool: 'inline-source-map',
module: {
rules: [
// instrument only testing sources with Istanbul
{
test: /\.js$/,
include: path.resolve('src/'),
exclude: path.resolve(__dirname, 'node_modules'),
use: [
{
loader: 'istanbul-instrumenter-loader',
options: { esModules: true }
}
]
}
]
devtool: 'inline-source-map',
resolve: {
extensions: ['.ts', '.js']
},
module: {
rules: [
{
test: /\.(ts|js)$/,
include: path.resolve(__dirname, 'src'),
exclude: path.resolve(__dirname, 'node_modules'),
loader: 'ts-loader'
},
// instrument only testing sources with Istanbul
{
test: /\.(ts|js)$/,
exclude: path.resolve(__dirname, 'node_modules'),
enforce: 'post',
use: [
{
loader: 'istanbul-instrumenter-loader',
options: { esModules: true }
}
]
}
]
},
plugins: [
new webpack.DefinePlugin({
Expand All @@ -65,31 +74,31 @@ module.exports = function(config) {
__USE_EME_DRM__: JSON.stringify(true)
})
]
},
},

// web server port
port: 9876,
// web server port
port: 9876,

// enable / disable colors in the output (reporters and logs)
colors: true,
// 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,
// 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: false,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,

// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['ChromeHeadless'],
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['ChromeHeadless'],

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,
// 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
});
// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity
});
};
29 changes: 26 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"ts-loader": "^4.4.2",
"ts-node": "^6.1.0",
"typescript": "^2.9.1",
"typescript-eslint-parser": "^16.0.0",
"typescript-eslint-parser": "^21.0.2",
"webpack": "^4.11.1",
"webpack-bundle-analyzer": "^2.9.1",
"webpack-cli": "^3.0.2",
Expand Down
Loading

0 comments on commit e2e480f

Please sign in to comment.