chore: use web test runner
This commit is contained in:
parent
48ba7a6bb4
commit
530540a9e1
6 changed files with 468 additions and 1936 deletions
|
|
@ -7,7 +7,7 @@ version: 2
|
|||
defaults: &defaults
|
||||
working_directory: ~/repo
|
||||
docker:
|
||||
- image: circleci/node:10.16.0-browsers
|
||||
- image: circleci/node:10.18.1-browsers
|
||||
|
||||
jobs:
|
||||
test:
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
/* eslint-disable import/no-extraneous-dependencies */
|
||||
const merge = require('webpack-merge');
|
||||
const bsSettings = require('@open-wc/testing-karma-bs/bs-settings.js');
|
||||
const createBaseConfig = require('./karma.conf.js');
|
||||
|
||||
module.exports = config => {
|
||||
config.set(
|
||||
merge.strategy({
|
||||
browsers: 'replace',
|
||||
})(bsSettings(config), createBaseConfig(config), {
|
||||
browserStack: {
|
||||
project: 'lion',
|
||||
},
|
||||
browsers: [
|
||||
'bs_win10_chrome_latest',
|
||||
// Only chrome for now
|
||||
// 'bs_win10_firefox_latest',
|
||||
// 'bs_win10_edge_latest',
|
||||
// 'bs_osxmojave_safari_latest',
|
||||
// 'bs_win10_ie_11',
|
||||
],
|
||||
}),
|
||||
);
|
||||
return config;
|
||||
};
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
/* eslint-disable import/no-extraneous-dependencies */
|
||||
const { createDefaultConfig } = require('@open-wc/testing-karma');
|
||||
const merge = require('webpack-merge');
|
||||
|
||||
module.exports = config => {
|
||||
config.set(
|
||||
merge(createDefaultConfig(config), {
|
||||
files: [
|
||||
// runs all files ending with .test in the test folder,
|
||||
// can be overwritten by passing a --grep flag. examples:
|
||||
//
|
||||
// npm run test -- --grep test/foo/bar.test.js
|
||||
// npm run test -- --grep test/bar/*
|
||||
{
|
||||
pattern: config.grep ? config.grep : 'packages/**/*/test/**/*.test.js',
|
||||
type: 'module',
|
||||
},
|
||||
],
|
||||
|
||||
esm: {
|
||||
nodeResolve: true,
|
||||
},
|
||||
|
||||
// TODO: improve coverage
|
||||
coverageIstanbulReporter: {
|
||||
thresholds: {
|
||||
global: {
|
||||
statements: 80,
|
||||
branches: 70,
|
||||
functions: 70,
|
||||
lines: 80,
|
||||
},
|
||||
},
|
||||
},
|
||||
}),
|
||||
);
|
||||
return config;
|
||||
};
|
||||
13
package.json
13
package.json
|
|
@ -22,12 +22,9 @@
|
|||
"storybook:build": "build-storybook",
|
||||
"storybook:build:start": "es-dev-server --root-dir storybook-static --open",
|
||||
"test": "run-p test:browser test:node",
|
||||
"test:browser": "karma start --coverage",
|
||||
"test:browser:watch": "karma start --auto-watch=true --single-run=false",
|
||||
"test:bs": "karma start karma.bs.config.js --coverage",
|
||||
"test:node": "lerna run test:node",
|
||||
"test:prune-snapshots": "karma start --prune-snapshots",
|
||||
"test:update-snapshots": "karma start --update-snapshots"
|
||||
"test:browser": "wtr packages/**/*/test/**/*.test.js --coverage",
|
||||
"test:browser:watch": "wtr packages/**/*/test/**/*.test.js --watch",
|
||||
"test:node": "lerna run test:node"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^7.0.0",
|
||||
|
|
@ -38,10 +35,8 @@
|
|||
"@open-wc/eslint-config": "^1.0.0",
|
||||
"@open-wc/testing": "^2.5.0",
|
||||
"@open-wc/testing-helpers": "^1.0.0",
|
||||
"@open-wc/testing-karma": "^3.2.30",
|
||||
"@open-wc/testing-karma-bs": "^1.3.30",
|
||||
"@open-wc/testing-wallaby": "^0.1.12",
|
||||
"@storybook/addon-a11y": "~5.0.0",
|
||||
"@web/test-runner": "^0.2.9",
|
||||
"@webcomponents/webcomponentsjs": "^2.2.5",
|
||||
"babel-eslint": "^8.2.6",
|
||||
"babel-polyfill": "^6.26.0",
|
||||
|
|
|
|||
12
web-test-runner.config.mjs
Normal file
12
web-test-runner.config.mjs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
export default {
|
||||
coverage: process.argv.includes('--coverage')
|
||||
? {
|
||||
thresholds: {
|
||||
statements: 80,
|
||||
branches: 70,
|
||||
functions: 70,
|
||||
lines: 80,
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
};
|
||||
Loading…
Reference in a new issue