- Linting (ESLint): As per latest ash-nazg (unicorn)

- npm: Update devDeps; use stable eslint-plugin-mocha-cleanup now that updated
- npm: Add scripts for reporting with test summaries (free of full noise during tests);
    auto-run at end of tests
- npm: Update devDeps. and use stable version of eslint-plugin-mocha-cleanup
master
Brett Zamir 2020-03-11 00:23:54 +08:00
parent 231fdb2189
commit f3a83dcb1d
23 changed files with 315 additions and 113 deletions

View File

@ -69,7 +69,7 @@ module.exports = {
}
},
{
files: ['.eslintrc.js', '.ncurc.js'],
files: ['.eslintrc.js', '.ncurc.js', 'tools/mochawesome-cli.js'],
extends: [
'plugin:node/recommended-script'
],

View File

@ -17,3 +17,5 @@ mochawesome-report/**
mochawesome.json
releases
tools

View File

@ -91,6 +91,7 @@
- npm: Update scripts to reflect removal of `all_tests.html`;
remove `browser-test` script
- npm: Add `add-release` script
- npm: Add reporting scripts (tests and coverage)
- npm: Add `license-badges`, `build-docs`, and `copy` scripts to `prepublishOnly` script
- npm: Rename `test-prep` to `prep` and other misc. script naming changes
- npm: Update `package-lock.json`

View File

@ -1,17 +1,17 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="116" height="20">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="110" height="20">
<linearGradient id="smooth" x2="0" y2="100%">
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
<stop offset="1" stop-opacity=".1"/>
</linearGradient>
<clipPath id="round">
<rect width="116" height="20" rx="3" fill="#fff"/>
<rect width="110" height="20" rx="3" fill="#fff"/>
</clipPath>
<g clip-path="url(#round)">
<rect width="63" height="20" fill="#555"/>
<rect x="63" width="53" height="20" fill="#fe7d37"/>
<rect width="116" height="20" fill="url(#smooth)"/>
<rect x="63" width="47" height="20" fill="#fe7d37"/>
<rect width="110" height="20" fill="url(#smooth)"/>
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110">
@ -20,8 +20,8 @@
<text x="325" y="150" fill="#010101" fill-opacity=".3" transform="scale(0.1)" textLength="530" lengthAdjust="spacing">Coverage</text>
<text x="325" y="140" transform="scale(0.1)" textLength="530" lengthAdjust="spacing">Coverage</text>
<text x="885" y="150" fill="#010101" fill-opacity=".3" transform="scale(0.1)" textLength="430" lengthAdjust="spacing">42.44%</text>
<text x="885" y="140" transform="scale(0.1)" textLength="430" lengthAdjust="spacing">42.44%</text>
<text x="855" y="150" fill="#010101" fill-opacity=".3" transform="scale(0.1)" textLength="370" lengthAdjust="spacing">42.5%</text>
<text x="855" y="140" transform="scale(0.1)" textLength="370" lengthAdjust="spacing">42.5%</text>
</g>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -515,7 +515,11 @@ var svgEditorExtension_imagelib = (function () {
url = _ref2.url,
description = _ref2.description;
// Todo: Adopt some standard formatting library like `fluent.js` instead
url = url.replace(/\{path\}/g, extIconsPath).replace(/\{modularVersion\}/g, modularVersion ? imagelibStrings.moduleEnding || '-es' : '');
url = url // Keep these regexes as is in prep. for switching to `u` flag
// which will require escaping
// eslint-disable-next-line unicorn/better-regex
.replace(/\{path\}/g, extIconsPath).replace( // eslint-disable-next-line unicorn/better-regex
/\{modularVersion\}/g, modularVersion ? imagelibStrings.moduleEnding || '-es' : '');
return {
name: name,
url: url,

8
dist/index-es.js vendored
View File

@ -18648,7 +18648,8 @@ function SvgCanvas(container, config) {
var _svgcontent = svgcontent,
nextSibling = _svgcontent.nextSibling;
var oldzoom = svgroot.removeChild(svgcontent);
svgcontent.remove();
var oldzoom = svgcontent;
batchCmd.addSubCommand(new RemoveElementCommand$1(oldzoom, nextSibling, svgroot)); // set new svg document
// If DOM3 adoptNode() available, use it. Otherwise fall back to DOM2 importNode()
@ -20719,7 +20720,8 @@ function SvgCanvas(container, config) {
var _t = t,
nextSibling = _t.nextSibling;
var elem = parent.removeChild(t);
t.remove();
var elem = t;
selectedCopy.push(selected); // for the copy
batchCmd.addSubCommand(new RemoveElementCommand$1(elem, nextSibling, parent));
@ -21255,7 +21257,7 @@ function SvgCanvas(container, config) {
clearSelection(); // delete the group element (but make undo-able)
var gNextSibling = g.nextSibling;
g = parent.removeChild(g);
g.remove();
batchCmd.addSubCommand(new RemoveElementCommand$1(g, gNextSibling, parent));
if (!batchCmd.isEmpty()) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

8
dist/index-umd.js vendored
View File

@ -18654,7 +18654,8 @@
var _svgcontent = svgcontent,
nextSibling = _svgcontent.nextSibling;
var oldzoom = svgroot.removeChild(svgcontent);
svgcontent.remove();
var oldzoom = svgcontent;
batchCmd.addSubCommand(new RemoveElementCommand$1(oldzoom, nextSibling, svgroot)); // set new svg document
// If DOM3 adoptNode() available, use it. Otherwise fall back to DOM2 importNode()
@ -20725,7 +20726,8 @@
var _t = t,
nextSibling = _t.nextSibling;
var elem = parent.removeChild(t);
t.remove();
var elem = t;
selectedCopy.push(selected); // for the copy
batchCmd.addSubCommand(new RemoveElementCommand$1(elem, nextSibling, parent));
@ -21261,7 +21263,7 @@
clearSelection(); // delete the group element (but make undo-able)
var gNextSibling = g.nextSibling;
g = parent.removeChild(g);
g.remove();
batchCmd.addSubCommand(new RemoveElementCommand$1(g, gNextSibling, parent));
if (!batchCmd.isEmpty()) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -909,7 +909,7 @@
};
}
document.body.removeChild(svg);
svg.remove();
}
return box.width;

View File

@ -18338,7 +18338,8 @@ var SvgCanvas = (function () {
var _svgcontent = svgcontent,
nextSibling = _svgcontent.nextSibling;
var oldzoom = svgroot.removeChild(svgcontent);
svgcontent.remove();
var oldzoom = svgcontent;
batchCmd.addSubCommand(new RemoveElementCommand$1(oldzoom, nextSibling, svgroot)); // set new svg document
// If DOM3 adoptNode() available, use it. Otherwise fall back to DOM2 importNode()
@ -20409,7 +20410,8 @@ var SvgCanvas = (function () {
var _t = t,
nextSibling = _t.nextSibling;
var elem = parent.removeChild(t);
t.remove();
var elem = t;
selectedCopy.push(selected); // for the copy
batchCmd.addSubCommand(new RemoveElementCommand$1(elem, nextSibling, parent));
@ -20945,7 +20947,7 @@ var SvgCanvas = (function () {
clearSelection(); // delete the group element (but make undo-able)
var gNextSibling = g.nextSibling;
g = parent.removeChild(g);
g.remove();
batchCmd.addSubCommand(new RemoveElementCommand$1(g, gNextSibling, parent));
if (!batchCmd.isEmpty()) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -22,8 +22,12 @@ export default {
imagelibStrings.imgLibs = imagelibStrings.imgLibs.map(({name, url, description}) => {
// Todo: Adopt some standard formatting library like `fluent.js` instead
url = url
// Keep these regexes as is in prep. for switching to `u` flag
// which will require escaping
// eslint-disable-next-line unicorn/better-regex
.replace(/\{path\}/g, extIconsPath)
.replace(
// eslint-disable-next-line unicorn/better-regex
/\{modularVersion\}/g,
modularVersion
? (imagelibStrings.moduleEnding || '-es')

View File

@ -428,7 +428,7 @@ const svgElementToPdf = function (element, pdf, options) {
} catch (error) {
box = {width: 0};
}
document.body.removeChild(svg);
svg.remove();
}
return box.width;
};

View File

@ -4511,7 +4511,9 @@ this.setSvgString = function (xmlString, preventUndo) {
// remove old svg document
const {nextSibling} = svgcontent;
const oldzoom = svgroot.removeChild(svgcontent);
svgcontent.remove();
const oldzoom = svgcontent;
batchCmd.addSubCommand(new RemoveElementCommand(oldzoom, nextSibling, svgroot));
// set new svg document
@ -6327,7 +6329,8 @@ this.deleteSelectedElements = function () {
}
const {nextSibling} = t;
const elem = parent.removeChild(t);
t.remove();
const elem = t;
selectedCopy.push(selected); // for the copy
batchCmd.addSubCommand(new RemoveElementCommand(elem, nextSibling, parent));
}
@ -6825,7 +6828,7 @@ this.ungroupSelectedElement = function () {
// delete the group element (but make undo-able)
const gNextSibling = g.nextSibling;
g = parent.removeChild(g);
g.remove();
batchCmd.addSubCommand(new RemoveElementCommand(g, gNextSibling, parent));
if (!batchCmd.isEmpty()) { addCommandToHistory(batchCmd); }

View File

@ -18651,7 +18651,8 @@
var _svgcontent = svgcontent,
nextSibling = _svgcontent.nextSibling;
var oldzoom = svgroot.removeChild(svgcontent);
svgcontent.remove();
var oldzoom = svgcontent;
batchCmd.addSubCommand(new RemoveElementCommand$1(oldzoom, nextSibling, svgroot)); // set new svg document
// If DOM3 adoptNode() available, use it. Otherwise fall back to DOM2 importNode()
@ -20722,7 +20723,8 @@
var _t = t,
nextSibling = _t.nextSibling;
var elem = parent.removeChild(t);
t.remove();
var elem = t;
selectedCopy.push(selected); // for the copy
batchCmd.addSubCommand(new RemoveElementCommand$1(elem, nextSibling, parent));
@ -21258,7 +21260,7 @@
clearSelection(); // delete the group element (but make undo-able)
var gNextSibling = g.nextSibling;
g = parent.removeChild(g);
g.remove();
batchCmd.addSubCommand(new RemoveElementCommand$1(g, gNextSibling, parent));
if (!batchCmd.isEmpty()) {

195
package-lock.json generated
View File

@ -1393,12 +1393,13 @@
}
},
"@cypress/code-coverage": {
"version": "1.12.2",
"resolved": "https://registry.npmjs.org/@cypress/code-coverage/-/code-coverage-1.12.2.tgz",
"integrity": "sha512-feHDX3Py7GBtk69Qjs3HC/bQwQxyEOhVfqZZ1s1vDYppCls6u7jdsK0uE8RvaJ7sEKYsHbPJB0C8Wa6k5/eH3A==",
"version": "1.14.0",
"resolved": "https://registry.npmjs.org/@cypress/code-coverage/-/code-coverage-1.14.0.tgz",
"integrity": "sha512-uzfbqPgNnLlzRLDX5lrW54gdacfjTcgkEY03JCltEhRwptQm5dtAZtHgNs0zVCBk/t02C/mlTq11QAJMUINzNA==",
"dev": true,
"requires": {
"@cypress/browserify-preprocessor": "2.1.4",
"bin-up": "1.3.2",
"debug": "4.1.1",
"execa": "4.0.0"
}
@ -2214,9 +2215,9 @@
"dev": true
},
"axe-core": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/axe-core/-/axe-core-3.5.1.tgz",
"integrity": "sha512-mwpDgPwWB+5kMHyLjlxh4w25ClJfqSxi+c6LQ4ix349TdCUctMwJNPTkhPD1qP9SYIjFgjeVpVZWCvK9oBGwCg==",
"version": "3.5.2",
"resolved": "https://registry.npmjs.org/axe-core/-/axe-core-3.5.2.tgz",
"integrity": "sha512-9wBDgdzbn06on6Xt+ay7EM4HV+NBOkeXhjK9DMezD8/qvJKeUTzheGHhM+U1uNaX4OvuIR4BePDStRLF7vyOfg==",
"dev": true
},
"babel-plugin-add-module-exports": {
@ -2350,6 +2351,77 @@
"tweetnacl": "^0.14.3"
}
},
"bin-up": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/bin-up/-/bin-up-1.3.2.tgz",
"integrity": "sha512-ePRL4VTK6jE/rXyoTH/YjzLRqp397y/dUSRXrPe8OcVP4min4bLJxNhmTdZfEF4zQYn4yYaI6WGy8M7F1mY1Aw==",
"dev": true,
"requires": {
"execa": "2.0.5"
},
"dependencies": {
"cross-spawn": {
"version": "6.0.5",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
"integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
"dev": true,
"requires": {
"nice-try": "^1.0.4",
"path-key": "^2.0.1",
"semver": "^5.5.0",
"shebang-command": "^1.2.0",
"which": "^1.2.9"
}
},
"execa": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/execa/-/execa-2.0.5.tgz",
"integrity": "sha512-SwmwZZyJjflcqLSgllk4EQlMLst2p9muyzwNugKGFlpAz6rZ7M+s2nBR97GAq4Vzjwx2y9rcMcmqzojwN+xwNA==",
"dev": true,
"requires": {
"cross-spawn": "^6.0.5",
"get-stream": "^5.0.0",
"is-stream": "^2.0.0",
"merge-stream": "^2.0.0",
"npm-run-path": "^3.0.0",
"onetime": "^5.1.0",
"p-finally": "^2.0.0",
"signal-exit": "^3.0.2",
"strip-final-newline": "^2.0.0"
}
},
"path-key": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
"dev": true
},
"shebang-command": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
"integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
"dev": true,
"requires": {
"shebang-regex": "^1.0.0"
}
},
"shebang-regex": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
"dev": true
},
"which": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
"dev": true,
"requires": {
"isexe": "^2.0.0"
}
}
}
},
"binary-extensions": {
"version": "1.13.1",
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz",
@ -4654,9 +4726,9 @@
}
},
"eslint-config-ash-nazg": {
"version": "17.3.0",
"resolved": "https://registry.npmjs.org/eslint-config-ash-nazg/-/eslint-config-ash-nazg-17.3.0.tgz",
"integrity": "sha512-Cri5paOgtuxCJ/y0JxtZK8m0LMujPqkNsv8iLuiW5gT05/LJALzL3hwNjshHhR5uF5i4NduoWPfKkgkZwTe5zw==",
"version": "17.4.0",
"resolved": "https://registry.npmjs.org/eslint-config-ash-nazg/-/eslint-config-ash-nazg-17.4.0.tgz",
"integrity": "sha512-F4UH+Vr2nsCfu7zMn3/+EPC3OEudLsKeK0M54qGlkdPB/uTAlcIDItP/DVWrKvW6QtWEqY3oaJNo8p0qVv0cDg==",
"dev": true
},
"eslint-config-standard": {
@ -4994,8 +5066,9 @@
}
},
"eslint-plugin-mocha-cleanup": {
"version": "git+https://github.com/brettz9/eslint-plugin-mocha-cleanup.git#9adea3da5eec23fbc90cff547be5e6ff93d81dd4",
"from": "git+https://github.com/brettz9/eslint-plugin-mocha-cleanup.git",
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-mocha-cleanup/-/eslint-plugin-mocha-cleanup-1.8.0.tgz",
"integrity": "sha512-LvnHn1FPz9NdMcORRl9sytr/chV99KPMEBzqc9QIqVJvy+93BhtFjq135kKrnVW4Re8QHJNZpkC4QakuvQ3qbg==",
"dev": true,
"requires": {
"requireindex": "~1.2.0"
@ -5094,9 +5167,9 @@
"dev": true
},
"eslint-plugin-unicorn": {
"version": "16.1.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-16.1.1.tgz",
"integrity": "sha512-IMxCsntb0T8s660Irc40gtzXtxuXHcOn36G9G8OYKfiseBD/kNrA1cNJhsJ0xQteDASGrFwqdzBsYEkUvczhOA==",
"version": "17.1.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-17.1.0.tgz",
"integrity": "sha512-yYNgXXSnFY73yvcaAB3z32SOY4km5NDzbY1mCSc6gVrKXgvGdU7K1IMJqQpoOrj2+QzdA1Mz0qLYn/ITGuNSFg==",
"dev": true,
"requires": {
"ci-info": "^2.0.0",
@ -5104,14 +5177,9 @@
"eslint-ast-utils": "^1.1.0",
"eslint-template-visitor": "^1.1.0",
"import-modules": "^2.0.0",
"lodash.camelcase": "^4.3.0",
"lodash.defaultsdeep": "^4.6.1",
"lodash.kebabcase": "^4.1.1",
"lodash.snakecase": "^4.1.1",
"lodash.upperfirst": "^4.3.1",
"lodash": "^4.17.15",
"read-pkg-up": "^7.0.1",
"regexp-tree": "^0.1.17",
"regexpp": "^3.0.0",
"regexp-tree": "^0.1.20",
"reserved-words": "^0.1.2",
"safe-regex": "^2.1.1",
"semver": "^7.1.2"
@ -5194,12 +5262,6 @@
"type-fest": "^0.8.1"
}
},
"regexpp": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.0.0.tgz",
"integrity": "sha512-Z+hNr7RAVWxznLPuA7DIh8UNX1j9CDrUQxskw9IrBE1Dxue2lyXT+shqEIeLUjrokxIP8CMy1WkjgG3rTsd5/g==",
"dev": true
},
"safe-regex": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-2.1.1.tgz",
@ -5273,14 +5335,20 @@
"multimap": "^1.0.2"
},
"dependencies": {
"acorn-jsx": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz",
"integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==",
"dev": true
},
"espree": {
"version": "6.1.2",
"resolved": "https://registry.npmjs.org/espree/-/espree-6.1.2.tgz",
"integrity": "sha512-2iUPuuPP+yW1PZaMSDM9eyVf8D5P0Hi8h83YtZ5bPc/zHYjII5khoixIUTMO794NOY8F/ThF1Bo8ncZILarUTA==",
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/espree/-/espree-6.2.0.tgz",
"integrity": "sha512-Xs8airJ7RQolnDIbLtRutmfvSsAe0xqMMAantCN/GMoqf81TFbeI1T7Jpd56qYu1uuh32dOG5W/X9uO+ghPXzA==",
"dev": true,
"requires": {
"acorn": "^7.1.0",
"acorn-jsx": "^5.1.0",
"acorn-jsx": "^5.2.0",
"eslint-visitor-keys": "^1.1.0"
}
}
@ -5409,6 +5477,17 @@
"onetime": "^5.1.0",
"signal-exit": "^3.0.2",
"strip-final-newline": "^2.0.0"
},
"dependencies": {
"npm-run-path": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",
"integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==",
"dev": true,
"requires": {
"path-key": "^3.0.0"
}
}
}
},
"executable": {
@ -8592,12 +8671,6 @@
"integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=",
"dev": true
},
"lodash.defaultsdeep": {
"version": "4.6.1",
"resolved": "https://registry.npmjs.org/lodash.defaultsdeep/-/lodash.defaultsdeep-4.6.1.tgz",
"integrity": "sha512-3j8wdDzYuWO3lM3Reg03MuQR957t287Rpcxp1njpEa8oDrikb+FwGdW3n+FELh/A6qib6yPit0j/pv9G/yeAqA==",
"dev": true
},
"lodash.flattendeep": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz",
@ -8634,12 +8707,6 @@
"integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=",
"dev": true
},
"lodash.kebabcase": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz",
"integrity": "sha1-hImxyw0p/4gZXM7KRI/21swpXDY=",
"dev": true
},
"lodash.memoize": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz",
@ -8652,12 +8719,6 @@
"integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=",
"dev": true
},
"lodash.snakecase": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz",
"integrity": "sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40=",
"dev": true
},
"lodash.sortby": {
"version": "4.7.0",
"resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz",
@ -8670,12 +8731,6 @@
"integrity": "sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw=",
"dev": true
},
"lodash.upperfirst": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz",
"integrity": "sha1-E2Xt9DFIBIHvDRxolXpe2Z1J984=",
"dev": true
},
"lodash.zip": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/lodash.zip/-/lodash.zip-4.2.0.tgz",
@ -10073,9 +10128,9 @@
}
},
"npm-run-path": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",
"integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==",
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-3.1.0.tgz",
"integrity": "sha512-Dbl4A/VfiVGLgQv29URL9xshU8XDY1GeLy+fsaZ1AA8JDSfjvr5P5+pzRbWqRSBxk6/DW7MIh8lTM/PaGnP2kg==",
"dev": true,
"requires": {
"path-key": "^3.0.0"
@ -11784,9 +11839,9 @@
}
},
"rollup": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.0.0.tgz",
"integrity": "sha512-tbvWownITR+0ebaX6iRr7IcLkziTCJacRpmWz03NIj3CZDmGlergYSwdG8wPx68LT0ms1YzqmbjUQHb6ut8pdw==",
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.0.3.tgz",
"integrity": "sha512-OjTD1pmtqCFaaoTl+zf3dXlG0FR1PudauQzAYmP5hDLLrrisXP6EuzAx9MY6En5bv61e8F6JGcVQxsVOcqFTUA==",
"dev": true,
"requires": {
"fsevents": "~2.1.2"
@ -11802,9 +11857,9 @@
}
},
"rollup-plugin-babel": {
"version": "4.3.3",
"resolved": "https://registry.npmjs.org/rollup-plugin-babel/-/rollup-plugin-babel-4.3.3.tgz",
"integrity": "sha512-tKzWOCmIJD/6aKNz0H1GMM+lW1q9KyFubbWzGiOG540zxPPifnEAHTZwjo0g991Y+DyOZcLqBgqOdqazYE5fkw==",
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/rollup-plugin-babel/-/rollup-plugin-babel-4.4.0.tgz",
"integrity": "sha512-Lek/TYp1+7g7I+uMfJnnSJ7YWoD58ajo6Oarhlex7lvUce+RCKRuGRSgztDO3/MF/PuGKmUL5iTHKf208UNszw==",
"dev": true,
"requires": {
"@babel/helper-module-imports": "^7.0.0",
@ -11822,9 +11877,9 @@
}
},
"rollup-plugin-terser": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-5.2.0.tgz",
"integrity": "sha512-jQI+nYhtDBc9HFRBz8iGttQg7li9klmzR62RG2W2nN6hJ/FI2K2ItYQ7kJ7/zn+vs+BP1AEccmVRjRN989I+Nw==",
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-5.3.0.tgz",
"integrity": "sha512-XGMJihTIO3eIBsVGq7jiNYOdDMb3pVxuzY0uhOE/FM4x/u9nQgr3+McsjzqBn3QfHIpNSZmFnpoKAwHBEcsT7g==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.5.5",
@ -12771,9 +12826,9 @@
"dev": true
},
"terser": {
"version": "4.6.3",
"resolved": "https://registry.npmjs.org/terser/-/terser-4.6.3.tgz",
"integrity": "sha512-Lw+ieAXmY69d09IIc/yqeBqXpEQIpDGZqT34ui1QWXIUpR2RjbqEkT8X7Lgex19hslSqcWM5iMN2kM11eMsESQ==",
"version": "4.6.6",
"resolved": "https://registry.npmjs.org/terser/-/terser-4.6.6.tgz",
"integrity": "sha512-4lYPyeNmstjIIESr/ysHg2vUPRGf2tzF9z2yYwnowXVuVzLEamPN1Gfrz7f8I9uEPuHcbFlW4PLIAsJoxXyJ1g==",
"dev": true,
"requires": {
"commander": "^2.20.0",

View File

@ -66,7 +66,14 @@
"cypress:merge": "mochawesome-merge \"cypress/results/mochaw*.json\" > mochawesome.json && marge mochawesome.json && mbg --file ./mochawesome.json --badge_output badges/tests-badge.svg",
"cypress:run-only": "rimraf \"cypress/results/mochaw*.json\" && rimraf \".nyc_output/*\" && cypress run",
"cypress:run-no-badge": "run-s -c cypress:run-only cypress:merge",
"cypress:run": "run-s -c cypress:run-no-badge coverage-badge",
"cypress:run": "run-s -c cypress:run-no-badge report-summary-mocha-full coverage-badge",
"mochawesome-cli": "node tools/mochawesome-cli.js",
"mochawesome-cli-dot": "npm run mochawesome-cli -- --dot",
"report-no-mochawesome": "nyc report",
"report-text-summary": "nyc report --reporter=text-summary",
"report": "run-s report-no-mochawesome mochawesome-cli",
"report-summary-mocha-full": "run-s report-text-summary mochawesome-cli",
"report-summary": "run-s report-text-summary mochawesome-cli-dot",
"test-only-no-report": "run-p start cypress:run",
"test-only": "run-s -c test-only-no-report report",
"test-no-cov-no-core-rollup": "run-s prep-no-core-rollup test-only",
@ -141,11 +148,11 @@
"@babel/plugin-transform-named-capturing-groups-regex": "^7.8.3",
"@babel/preset-env": "^7.8.7",
"@babel/register": "^7.8.6",
"@cypress/code-coverage": "^1.12.2",
"@cypress/code-coverage": "^1.14.0",
"@cypress/fiddle": "^1.4.2",
"@fintechstudios/eslint-plugin-chai-as-promised": "^2.0.0",
"@mysticatea/eslint-plugin": "^13.0.0",
"axe-core": "^3.5.1",
"axe-core": "^3.5.2",
"babel-plugin-transform-object-rest-spread": "^7.0.0-beta.3",
"coffeescript": "^2.5.1",
"copyfiles": "^2.2.0",
@ -156,7 +163,7 @@
"cypress-multi-reporters": "^1.2.4",
"deparam": "git+https://github.com/brettz9/deparam.git#updates",
"eslint": "^6.8.0",
"eslint-config-ash-nazg": "^17.3.0",
"eslint-config-ash-nazg": "^17.4.0",
"eslint-config-standard": "^14.1.0",
"eslint-plugin-array-func": "^3.1.4",
"eslint-plugin-chai-expect": "^2.1.0",
@ -170,14 +177,14 @@
"eslint-plugin-jsdoc": "^22.0.0",
"eslint-plugin-markdown": "^1.0.2",
"eslint-plugin-mocha": "^6.3.0",
"eslint-plugin-mocha-cleanup": "https://github.com/brettz9/eslint-plugin-mocha-cleanup",
"eslint-plugin-mocha-cleanup": "^1.8.0",
"eslint-plugin-no-unsanitized": "^3.0.2",
"eslint-plugin-no-use-extend-native": "^0.4.1",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-sonarjs": "^0.5.0",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-unicorn": "^16.1.1",
"eslint-plugin-unicorn": "^17.1.0",
"frs-replace": "^2.0.1",
"gh-badges": "^2.2.1",
"imageoptim-cli": "^3.0.2",
@ -201,10 +208,10 @@
"remark-cli": "^7.0.1",
"remark-lint-ordered-list-marker-value": "^1.0.4",
"rimraf": "^3.0.2",
"rollup": "2.0.0",
"rollup-plugin-babel": "^4.3.3",
"rollup": "2.0.3",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-re": "^1.0.7",
"rollup-plugin-terser": "^5.2.0",
"rollup-plugin-terser": "^5.3.0",
"stackblur-canvas": "^2.2.0",
"typescript": "^3.8.3",
"underscore": "^1.6.0"

View File

@ -18651,7 +18651,8 @@
var _svgcontent = svgcontent,
nextSibling = _svgcontent.nextSibling;
var oldzoom = svgroot.removeChild(svgcontent);
svgcontent.remove();
var oldzoom = svgcontent;
batchCmd.addSubCommand(new RemoveElementCommand$1(oldzoom, nextSibling, svgroot)); // set new svg document
// If DOM3 adoptNode() available, use it. Otherwise fall back to DOM2 importNode()
@ -20722,7 +20723,8 @@
var _t = t,
nextSibling = _t.nextSibling;
var elem = parent.removeChild(t);
t.remove();
var elem = t;
selectedCopy.push(selected); // for the copy
batchCmd.addSubCommand(new RemoveElementCommand$1(elem, nextSibling, parent));
@ -21258,7 +21260,7 @@
clearSelection(); // delete the group element (but make undo-able)
var gNextSibling = g.nextSibling;
g = parent.removeChild(g);
g.remove();
batchCmd.addSubCommand(new RemoveElementCommand$1(g, gNextSibling, parent));
if (!batchCmd.isEmpty()) {

116
tools/mochawesome-cli.js Normal file
View File

@ -0,0 +1,116 @@
/* eslint-disable no-console, compat/compat */
// Filed the following to support this file's functionality:
// https://github.com/cypress-io/cypress/issues/6585
// Todo: Show /test (i.e., `unit.js`) test results at beginning?
// See https://github.com/jsdoc/jsdoc/issues/1750 to create such tags
/* eslint "jsdoc/check-tag-names": ["error", {definedTags: ["cli-arg"]}] */
/**
* @file A CLI reporter against after-the-fact compiled (merged Mochawesome)
* Mocha results.
* @cli-arg {"doc"|"dot"|"json-stream"|"json"|"landing"|"list"|
* "markdown"|"min"|"nyan"|"progress"|"spec"|"tap"|
* "xunit"} [0="spec"] The Mocha reporter to use
*/
'use strict';
const reporterFile = process.argv[2]
? process.argv[2].replace(/^--/u, '')
: 'spec';
// eslint-disable-next-line import/no-dynamic-require
const MochaReporter = require(`mocha/lib/reporters/${reporterFile}.js`);
const Suite = require('mocha/lib/suite.js');
const Test = require('mocha/lib/test.js');
const Runner = require('mocha/lib/runner.js');
const {constants: {
EVENT_RUN_BEGIN,
EVENT_RUN_END,
EVENT_SUITE_BEGIN,
EVENT_SUITE_END,
EVENT_TEST_FAIL,
EVENT_TEST_PASS,
EVENT_TEST_PENDING
}} = require('mocha/lib/runner.js');
const {results, stats} = require('../mochawesome.json');
const runner = new Runner(
new Suite('', null, true)
);
runner.stats = stats;
console.log('Mocha results:');
// eslint-disable-next-line no-new
new MochaReporter(runner);
runner.emit(EVENT_RUN_BEGIN);
results.forEach(({suites}) => {
suites.forEach(function handleSuite (st) {
const ste = Object.assign(new Suite(''), st);
ste.suites.forEach((s, i) => {
ste.suites[i] = handleSuite(s);
});
runner.emit(EVENT_SUITE_BEGIN, ste);
ste.tests.forEach((ts) => {
const tst = new Test('', () => {
//
});
Object.entries(ts).forEach(([k, v]) => {
// `fullTitle` is a string in mochawesome but a function in Mocha
if (k !== 'fullTitle') {
tst[k] = v;
}
});
tst.parent = ste; // Seems to work
const ev = tst.pass
? EVENT_TEST_PASS
: tst.fail
? EVENT_TEST_FAIL
// No distinct event for pending vs. skipped?
: tst.pending
? EVENT_TEST_PENDING
: tst.skipped
? EVENT_TEST_PENDING
: null;
if (!ev) {
throw new Error(
'Unexpected test event (not passing, failing, or pending): ' +
tst.title
);
}
runner.emit(ev, tst, tst.fail ? tst.err : undefined);
});
runner.emit(EVENT_SUITE_END, ste);
return ste;
});
});
runner.emit(EVENT_RUN_END);
const {
// passes, tests, pending,
end
} = stats;
/*
console.log(
`Passing ${passes}/${tests}${pending ? `Pending ${pending}` : ''}`
);
*/
const endDate = new Date(Date.parse(end));
const lastRan = new Intl.DateTimeFormat('en-US', {
year: 'numeric', month: 'numeric', day: 'numeric',
hour: 'numeric', minute: 'numeric'
}).format(endDate);
console.log(
`Tests finished: ${lastRan}`
);