Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit 4121655

Browse files
Goamandmo-odoo
authored andcommitted
[FIX] Tests: make them faster
Before this commit, all individual test files were containing all the source and sourcemap. Which created performance issues. N test files where N big bundles. Now all test files are all container within 1 big bundle.
1 parent a163bb5 commit 4121655

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

karma.conf.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const path = require('path');
2+
const webpack = require('webpack');
23

34
module.exports = function(config) {
45
const coverageReporters = [];
@@ -81,15 +82,15 @@ module.exports = function(config) {
8182
frameworks: ['mocha', 'chai', 'sinon'],
8283

8384
// list of files / patterns to load in the browser
84-
files: config.includeFiles ? config.includeFiles.split(',') : ['packages/**/test/**/*.ts'],
85+
files: ['test_index.ts'],
8586

8687
// list of files / patterns to exclude
8788
exclude: [],
8889

8990
// preprocess matching files before serving them to the browser
9091
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
9192
preprocessors: {
92-
'packages/**/test/**/*.ts': ['webpack'],
93+
'test_index.ts': ['webpack'],
9394
},
9495

9596
// test results reporter to use

test_index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// load all specs into one bundle
2+
const testsContext = (require as any).context('./packages/', true, /.test.ts$/i);
3+
testsContext.keys().forEach(testsContext);

0 commit comments

Comments
 (0)