feat(common/web): adds c8 for web/utils, web/keyboard-processor

This commit is contained in:
Joshua A. Horton 2023-06-12 10:51:35 +07:00
parent 833f3aed40
commit b41b619dfd
17 changed files with 47 additions and 16 deletions

View file

@ -6,7 +6,6 @@
*/
import esbuild from 'esbuild';
import { spawn } from 'child_process';
// Bundled ES module version
esbuild.buildSync({

View file

@ -0,0 +1,15 @@
{
"check-coverage": false,
"clean": true,
"exclude": [
"src/keyboards/loaders/dom*",
"node_modules/*",
"tests"
],
"exclude-after-remap": true,
"reporter": ["text", "text-summary"],
"reports-dir": "build/coverage",
"src": [
"src/"
]
}

View file

@ -6,7 +6,6 @@
*/
import esbuild from 'esbuild';
import { spawn } from 'child_process';
/** @type {esbuild.BuildOptions} */
const commonConfig = {

View file

@ -69,7 +69,7 @@ if builder_start_action test; then
KARMA_CONFIG=CI.conf.cjs
fi
mocha --recursive $MOCHA_FLAGS ./tests/node/
c8 mocha --recursive $MOCHA_FLAGS ./tests/node/
karma start ./tests/dom/$KARMA_CONFIG
builder_finish_action success test

View file

@ -18,6 +18,7 @@
"homepage": "https://github.com/keymanapp/keyman#readme",
"devDependencies": {
"@keymanapp/resources-gosh": "*",
"c8": "^7.12.0",
"chai": "^4.3.4",
"karma": "^6.4.1",
"karma-chai": "^0.1.0",
@ -35,7 +36,8 @@
"clean": "tsc -b --clean tsconfig.json",
"karma": "karma",
"test": "gosh ./test.sh",
"mocha": "mocha"
"mocha": "mocha",
"c8": "c8"
},
"dependencies": {
"@keymanapp/models-types": "*",

View file

@ -548,6 +548,7 @@ export class Layouts {
}
// Defines the default visual layout for a keyboard.
/* c8 ignore start */
static dfltLayout: LayoutSpec = {
"desktop":
{
@ -847,4 +848,5 @@ export class Layouts {
]
}
};
/* c8 ignore end */
}

View file

@ -9,7 +9,6 @@
"importHelpers": true,
"inlineSources": true,
"sourceMap": true,
"sourceRoot": "keyman/",
"target": "es5",
"types": ["node"],
"lib": ["es6"],

View file

@ -8,7 +8,6 @@
"declaration": true,
"inlineSources": true,
"sourceMap": true,
"sourceRoot": "keyman/",
"target": "es5",
"types": ["node"],
"lib": ["es6"],

View file

@ -1,5 +0,0 @@
// This specific module is allowed to reference the DOM in order to facilitate loading the keyboards
// into the DOM.
///<reference lib="dom" />

View file

@ -9,7 +9,6 @@
"importHelpers": true,
"inlineSources": true,
"sourceMap": true,
"sourceRoot": "keyman/",
"target": "es5",
"types": ["node"],
"lib": ["es6"],

View file

@ -9,7 +9,6 @@
"importHelpers": true,
"inlineSources": true,
"sourceMap": true,
"sourceRoot": "keyman/",
"target": "es5",
"types": ["node"],
"lib": ["es6"],

View file

@ -0,0 +1,17 @@
{
"all": true,
"check-coverage": false,
"clean": true,
"exclude": [
"src/deviceSpec.ts",
"src/globalObject.ts",
"node_modules/*",
"src/test"
],
"exclude-after-remap": true,
"reporter": ["text", "text-summary"],
"reports-dir": "build/coverage",
"src": [
"src/"
]
}

View file

@ -58,7 +58,7 @@ if builder_start_action test; then
FLAGS="$FLAGS --reporter mocha-teamcity-reporter"
fi
mocha --recursive $FLAGS ./src/test/
c8 mocha --recursive $FLAGS ./src/test/
builder_finish_action success test
fi

View file

@ -19,6 +19,7 @@
},
"scripts": {
"build": "gosh ./build.sh",
"c8": "c8",
"clean": "tsc -b --clean",
"mocha": "mocha",
"tsc": "tsc"
@ -36,6 +37,7 @@
"devDependencies": {
"@keymanapp/resources-gosh": "*",
"@keymanapp/keyman-version": "*",
"c8": "^7.12.0",
"chai": "^4.3.4",
"mocha": "^10.0.0",
"mocha-teamcity-reporter": "^4.0.0",

View file

@ -1,6 +1,6 @@
import { assert } from 'chai';
import ManagedPromise from '../../build/obj/managedPromise.js';
import { ManagedPromise } from '@keymanapp/web-utils';
describe("ManagedPromise", () => {
it('<void> resolution', async () => {

View file

@ -1,6 +1,6 @@
import { assert } from 'chai';
import Version from '../../build/obj/version.js';
import { Version } from '@keymanapp/web-utils';
describe('Version Logic', function() {
it('Should provide a default, fallback value when nothing is specified', function() {

4
package-lock.json generated
View file

@ -227,6 +227,7 @@
"@keymanapp/kmc": "*",
"@keymanapp/resources-gosh": "*",
"@types/node": "^11.9.4",
"c8": "^7.12.0",
"chai": "^4.3.4",
"mocha": "^10.0.0",
"mocha-teamcity-reporter": "^4.0.0",
@ -245,6 +246,7 @@
},
"devDependencies": {
"@keymanapp/resources-gosh": "*",
"c8": "^7.12.0",
"chai": "^4.3.4",
"karma": "^6.4.1",
"karma-chai": "^0.1.0",
@ -296,6 +298,7 @@
"@keymanapp/models-types": "*",
"@keymanapp/resources-gosh": "*",
"@types/node": "^10.17.21",
"c8": "^7.12.0",
"chai": "^4.3.4",
"combine-source-map": "^0.8.0",
"karma": "^6.4.1",
@ -608,6 +611,7 @@
"@keymanapp/keyman-version": "*",
"@keymanapp/resources-gosh": "*",
"@types/node": "^14.0.5",
"c8": "^7.12.0",
"chai": "^4.3.4",
"mocha": "^10.0.0",
"mocha-teamcity-reporter": "^4.0.0",