feat: added automated tests to test our code in the browser · javascriptdata/scikit.js@87e06a2 · GitHub
Skip to content

Commit 87e06a2

Browse files
committed
feat: added automated tests to test our code in the browser
1 parent 8d813b4 commit 87e06a2

9 files changed

Lines changed: 2880 additions & 645 deletions

‎.gitignore‎

Lines changed: 1 addition & 0 deletions

‎esbuild.config.js‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
let esbuild = require('esbuild')
2+
esbuild
3+
.build({
4+
entryPoints: ['src/index.test.ts'],
5+
bundle: true,
6+
platform: 'browser',
7+
format: 'iife',
8+
outfile: 'out.js'
9+
})
10+
.catch(() => process.exit(1))

‎karma.config.js‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module.exports = function (config) {
2+
config.set({
3+
plugins: ['karma-webpack', 'karma-jasmine', 'karma-chrome-launcher'],
4+
5+
// base path that will be used to resolve all patterns (eg. files, exclude)
6+
basePath: '',
7+
8+
// frameworks to use
9+
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
10+
frameworks: ['jasmine'],
11+
12+
// list of files / patterns to load in the browser
13+
// Here I'm including all of the the Jest tests which are all under the __tests__ directory.
14+
// You may need to tweak this pattern to find your test files/
15+
files: ['./karma-setup.js', 'out.js'],
16+
browsers: ['ChromeHeadless'],
17+
singleRun: true
18+
})
19+
}

‎karma.setup.js‎

Lines changed: 14 additions & 0 deletions

0 commit comments

Comments
 (0)