Skip to content

Commit 4378860

Browse files
Merge pull request #94 from RobotlegsJS/karma-webpack
Improve performance of Karma
2 parents 41dc10b + f3f0fea commit 4378860

File tree

5 files changed

+21
-3
lines changed

5 files changed

+21
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626

2727
- Migrate to headless Chrome (see #92).
2828

29+
- Improve performance of Karma (see #94).
30+
2931
- Update dev dependencies to latest version.
3032

3133
### [v0.2.0](https://github.com/RobotlegsJS/SignalsJS/releases/tag/0.2.0) - 2018-08-02

karma.conf.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ module.exports = config => {
1919
"es6-shim"
2020
],
2121
files: [
22-
{ pattern: "./test/**/**/**.test.ts", include: true },
22+
{ pattern: "./test/index.ts", include: true },
2323
{ pattern: '**/*.map', served: true, included: false, watched: true }
2424
],
2525
preprocessors: {
26-
"./**/**/**/**.ts": ["sourcemap"],
27-
"./test/**/**/**.test.ts": ["webpack"]
26+
"./test/index.ts": ["webpack"],
27+
"./**/**/**/**.ts": ["sourcemap"]
2828
},
2929
webpack: webpackConfig,
3030
webpackMiddleware: {
@@ -41,6 +41,9 @@ module.exports = config => {
4141
"karma-es6-shim",
4242
"karma-coverage-istanbul-reporter"
4343
],
44+
mime: {
45+
"text/x-typescript": ["ts","tsx"]
46+
},
4447
reporters: (
4548
config.singleRun ?
4649
["dots", "mocha", "coverage-istanbul"] :

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
"@types/chai": "^4.1.7",
7272
"@types/mocha": "^5.2.5",
7373
"@types/sinon": "^5.0.7",
74+
"@types/webpack-env": "^1.13.6",
7475
"bluebird": "^3.5.3",
7576
"browserify-versionify": "^1.0.6",
7677
"chai": "^4.2.0",

test/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/// <reference types="webpack-env" />
2+
3+
// require all modules ending in ".test.ts" from the
4+
// current directory and all subdirectories
5+
const testsContext = require.context(".", true, /\.test\.ts$/);
6+
7+
testsContext.keys().forEach(testsContext);

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@
143143
resolved "https://registry.npmjs.org/@types/sinon/-/sinon-5.0.7.tgz#0d9f89dd0c9988c4f1505a92a3a324ee7bdb18a6"
144144
integrity sha512-opwMHufhUwkn/UUDk35LDbKJpA2VBsZT8WLU8NjayvRLGPxQkN+8XmfC2Xl35MAscBE8469koLLBjaI3XLEIww==
145145

146+
"@types/webpack-env@^1.13.6":
147+
version "1.13.6"
148+
resolved "http://registry.npmjs.org/@types/webpack-env/-/webpack-env-1.13.6.tgz#128d1685a7c34d31ed17010fc87d6a12c1de6976"
149+
integrity sha512-5Th3OsZ4gTRdr9Mho83BQ23cex4sRhOR4XTG+m+cJc0FhtUBK9Vn62hBJ+pnQYnSxoPOsKoAPOx6FcphxBC8ng==
150+
146151
"@webassemblyjs/[email protected]":
147152
version "1.7.11"
148153
resolved "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.7.11.tgz#b988582cafbb2b095e8b556526f30c90d057cace"

0 commit comments

Comments
 (0)