-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from msgpack/karma-config
setup Karma config
- Loading branch information
Showing
7 changed files
with
6,477 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ node_modules/ | |
dist/ | ||
dist.es5/ | ||
build/ | ||
package-lock.json | ||
.nyc_output/ | ||
coverage/ | ||
benchmark/sandbox.ts | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
# https://docs.travis-ci.com/user/languages/javascript-with-nodejs/ | ||
language: node_js | ||
addons: | ||
firefox: latest | ||
node_js: | ||
- "10" | ||
- "12" | ||
- "lts/*" | ||
- "node" | ||
cache: npm | ||
before_install: npm install -g nyc codecov | ||
script: npm run test:cover | ||
install: | ||
- npm install -g nyc codecov | ||
- npm ci | ||
script: | ||
- npm run test:browser:firefox | ||
- npm run test:cover | ||
after_success: | ||
- nyc report --reporter=json > coverage/coverage.json | ||
- codecov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
const webpackConfig = require("./webpack.config.js"); | ||
|
||
export default function configure(config: any) { | ||
config.set({ | ||
browsers: ["FirefoxHeadless", "ChromeHeadless"], | ||
|
||
basePath: "", | ||
frameworks: ["mocha"], | ||
files: ["./test/karma-run.ts"], | ||
exclude: [], | ||
preprocessors: { | ||
"**/*.ts": ["webpack", "sourcemap"], | ||
}, | ||
reporters: ["mocha"], | ||
port: 9876, | ||
colors: true, | ||
logLevel: config.LOG_INFO, | ||
autoWatch: true, | ||
singleRun: false, | ||
concurrency: 2, | ||
|
||
webpack: { | ||
mode: "development", | ||
|
||
// Handles NodeJS polyfills | ||
// https://webpack.js.org/configuration/node | ||
// Note that the dependencies in https://github.com/webpack/node-libs-browser are sometimes too old. | ||
node: { | ||
assert: false, | ||
util: false, | ||
buffer: false, | ||
}, | ||
resolve: { | ||
...webpackConfig.resolve, | ||
alias: { | ||
assert$: "assert/assert.js", | ||
}, | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.tsx?$/, | ||
loader: "ts-loader", | ||
options: { | ||
configFile: "tsconfig.karma.json", | ||
// FIXME: some types for dependencies cannot be resolved, so ignore type checking for now. | ||
transpileOnly: true, | ||
}, | ||
}, | ||
], | ||
}, | ||
optimization: { | ||
minimize: false, | ||
}, | ||
devtool: "inline-source-map", | ||
}, | ||
mime: { | ||
"text/x-typescript": ["ts", "tsx"], | ||
}, | ||
}); | ||
} |
Oops, something went wrong.