Skip to content

Commit f086add

Browse files
committed
Test on headless Chrome using karma
1 parent fc4c9b4 commit f086add

File tree

7 files changed

+5707
-239
lines changed

7 files changed

+5707
-239
lines changed

.github/workflows/browser.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: test-browser
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- run: npm ci
17+
- run: npm run test-browser
18+
env:
19+
CI: true

.github/workflows/nodejs.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3-
4-
name: build
1+
name: test-nodejs
52

63
on:
74
push:

karma.conf.js

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// Karma configuration
2+
// Generated on Mon Oct 04 2021 18:19:34 GMT+0900 (Japan Standard Time)
3+
4+
module.exports = function (config) {
5+
config.set({
6+
// base path that will be used to resolve all patterns (eg. files, exclude)
7+
basePath: "",
8+
9+
// frameworks to use
10+
// available frameworks: https://www.npmjs.com/search?q=keywords:karma-adapter
11+
frameworks: ["mocha", "karma-typescript"],
12+
13+
// list of files / patterns to load in the browser
14+
files: ["test/*.ts", "lib/*.ts"],
15+
16+
// list of files / patterns to exclude
17+
exclude: [],
18+
19+
// preprocess matching files before serving them to the browser
20+
// available preprocessors: https://www.npmjs.com/search?q=keywords:karma-preprocessor
21+
preprocessors: {
22+
"**/*.ts": "karma-typescript", // *.tsx for React Jsx
23+
},
24+
25+
// test results reporter to use
26+
// possible values: 'dots', 'progress'
27+
// available reporters: https://www.npmjs.com/search?q=keywords:karma-reporter
28+
reporters: ["progress", "karma-typescript"],
29+
30+
// web server port
31+
port: 9876,
32+
33+
// enable / disable colors in the output (reporters and logs)
34+
colors: true,
35+
36+
// level of logging
37+
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
38+
logLevel: config.LOG_INFO,
39+
40+
// enable / disable watching file and executing tests whenever any file changes
41+
autoWatch: true,
42+
43+
// start these browsers
44+
// available browser launchers: https://www.npmjs.com/search?q=keywords:karma-launcher
45+
browsers: ["Chrome"],
46+
47+
// Continuous Integration mode
48+
// if true, Karma captures browsers, runs the tests and exits
49+
singleRun: false,
50+
51+
// Concurrency level
52+
// how many browser instances should be started simultaneously
53+
concurrency: Infinity,
54+
});
55+
};

0 commit comments

Comments
 (0)