@powerlines/plugin-jest 0.1.437 → 0.1.439
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.cjs +1 -29
- package/dist/index.cjs +7 -108
- package/dist/index.mjs +7 -104
- package/dist/types/index.mjs +1 -1
- package/dist/types/plugin.mjs +1 -1
- package/package.json +4 -4
|
@@ -1,29 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
-
key = keys[i];
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
-
__defProp(to, key, {
|
|
14
|
-
get: ((k) => from[k]).bind(null, key),
|
|
15
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
-
value: mod,
|
|
24
|
-
enumerable: true
|
|
25
|
-
}) : target, mod));
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
|
|
29
|
-
exports.__toESM = __toESM;
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));exports.__toESM=s;
|
package/dist/index.cjs
CHANGED
|
@@ -1,108 +1,7 @@
|
|
|
1
|
-
Object.defineProperties(exports,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
//#region src/index.ts
|
|
10
|
-
/**
|
|
11
|
-
* Jest plugin for Powerlines.
|
|
12
|
-
*
|
|
13
|
-
* @param options - The Jest plugin user configuration options.
|
|
14
|
-
* @returns A Powerlines plugin that integrates Jest testing.
|
|
15
|
-
*/
|
|
16
|
-
const plugin = (options = {}) => {
|
|
17
|
-
return {
|
|
18
|
-
name: "jest",
|
|
19
|
-
async config() {
|
|
20
|
-
const config = {
|
|
21
|
-
$0: void 0,
|
|
22
|
-
_: [],
|
|
23
|
-
coverage: options.codeCoverage,
|
|
24
|
-
bail: options.bail,
|
|
25
|
-
cache: true,
|
|
26
|
-
cacheDirectory: (0, _stryke_path_join.joinPaths)(this.cachePath, "jest"),
|
|
27
|
-
ci: options.ci,
|
|
28
|
-
color: options.colors ?? true,
|
|
29
|
-
debug: this.config.mode === "development",
|
|
30
|
-
detectOpenHandles: options.detectOpenHandles,
|
|
31
|
-
forceExit: options.forceExit,
|
|
32
|
-
logHeapUsage: options.logHeapUsage,
|
|
33
|
-
detectLeaks: options.detectLeaks,
|
|
34
|
-
json: options.json,
|
|
35
|
-
maxWorkers: options.maxWorkers,
|
|
36
|
-
onlyChanged: options.onlyChanged,
|
|
37
|
-
changedSince: options.changedSince,
|
|
38
|
-
outputFile: options.outputFile,
|
|
39
|
-
passWithNoTests: options.passWithNoTests,
|
|
40
|
-
runInBand: options.runInBand,
|
|
41
|
-
showConfig: options.showConfig,
|
|
42
|
-
silent: options.silent,
|
|
43
|
-
testLocationInResults: options.testLocationInResults,
|
|
44
|
-
testNamePattern: options.testNamePattern,
|
|
45
|
-
testPathPatterns: options.testPathPatterns,
|
|
46
|
-
testPathIgnorePatterns: options.testPathIgnorePatterns,
|
|
47
|
-
testTimeout: options.testTimeout,
|
|
48
|
-
colors: options.colors ?? true,
|
|
49
|
-
verbose: options.verbose,
|
|
50
|
-
testResultsProcessor: options.testResultsProcessor,
|
|
51
|
-
updateSnapshot: options.updateSnapshot,
|
|
52
|
-
useStderr: options.useStderr,
|
|
53
|
-
watch: options.watch,
|
|
54
|
-
watchAll: options.watchAll,
|
|
55
|
-
randomize: options.randomize
|
|
56
|
-
};
|
|
57
|
-
if (options.testFile) config._.push(options.testFile);
|
|
58
|
-
if (options.findRelatedTests) {
|
|
59
|
-
const parsedTests = options.findRelatedTests.map((s) => s.trim());
|
|
60
|
-
config._.push(...parsedTests);
|
|
61
|
-
config.findRelatedTests = true;
|
|
62
|
-
}
|
|
63
|
-
if (options.coverageDirectory) config.coverageDirectory = (0, _stryke_path_join.joinPaths)(this.config.cwd, options.coverageDirectory);
|
|
64
|
-
if (options.clearCache) config.clearCache = true;
|
|
65
|
-
if (options.reporters && options.reporters.length > 0) config.reporters = options.reporters;
|
|
66
|
-
if (Array.isArray(options.coverageReporters) && options.coverageReporters.length > 0) config.coverageReporters = options.coverageReporters;
|
|
67
|
-
return { test: { jest: config } };
|
|
68
|
-
},
|
|
69
|
-
async test() {
|
|
70
|
-
if (this.config.test.jest) {
|
|
71
|
-
const { results } = await (0, jest.runCLI)(this.config.test.jest, [(0, _stryke_path_join.joinPaths)(this.config.cwd, this.config.root)]);
|
|
72
|
-
const snapshotResults = results.snapshot;
|
|
73
|
-
const snapshotsAdded = snapshotResults.added;
|
|
74
|
-
const snapshotsFailed = snapshotResults.unmatched;
|
|
75
|
-
const snapshotsOutdated = snapshotResults.unchecked;
|
|
76
|
-
const snapshotsFilesRemoved = snapshotResults.filesRemoved;
|
|
77
|
-
const snapshotsDidUpdate = snapshotResults.didUpdate;
|
|
78
|
-
const snapshotsPassed = snapshotResults.matched;
|
|
79
|
-
const snapshotsTotal = snapshotResults.total;
|
|
80
|
-
const snapshotsUpdated = snapshotResults.updated;
|
|
81
|
-
const suitesFailed = results.numFailedTestSuites;
|
|
82
|
-
const suitesPassed = results.numPassedTestSuites;
|
|
83
|
-
const suitesPending = results.numPendingTestSuites;
|
|
84
|
-
const suitesRun = suitesFailed + suitesPassed;
|
|
85
|
-
const suitesTotal = results.testResults.length;
|
|
86
|
-
const testsFailed = results.numFailedTests;
|
|
87
|
-
const testsPassed = results.numPassedTests;
|
|
88
|
-
const testsPending = results.numPendingTests;
|
|
89
|
-
const testsTodo = results.numTodoTests;
|
|
90
|
-
const testsTotal = results.numTotalTests;
|
|
91
|
-
const suites = `${chalk.default.bold("Test Suites: ") + (suitesFailed ? `${chalk.default.bold(chalk.default.red(`${suitesFailed} failed`))}, ` : "") + (suitesPending ? `${chalk.default.bold(chalk.default.yellow(`${suitesPending} skipped`))}, ` : "") + (suitesPassed ? `${chalk.default.bold(chalk.default.green(`${suitesPassed} passed`))}, ` : "") + (suitesRun !== suitesTotal ? `${suitesRun} of ${suitesTotal}` : suitesTotal)} total`;
|
|
92
|
-
const tests = `${chalk.default.bold("Tests: ") + (testsFailed > 0 ? `${chalk.default.bold(chalk.default.red(`${testsFailed} failed`))}, ` : "") + (testsPending > 0 ? `${chalk.default.bold(chalk.default.yellow(`${testsPending} skipped`))}, ` : "") + (testsTodo > 0 ? `${chalk.default.bold(chalk.default.magenta(`${testsTodo} todo`))}, ` : "") + (testsPassed > 0 ? `${chalk.default.bold(chalk.default.green(`${testsPassed} passed`))}, ` : "")}${testsTotal} total`;
|
|
93
|
-
const snapshots = `${chalk.default.bold("Snapshots: ") + (snapshotsFailed ? `${chalk.default.bold(chalk.default.red(`${snapshotsFailed} failed`))}, ` : "") + (snapshotsOutdated && !snapshotsDidUpdate ? `${chalk.default.bold(chalk.default.yellow(`${snapshotsOutdated} obsolete`))}, ` : "") + (snapshotsOutdated && snapshotsDidUpdate ? `${chalk.default.bold(chalk.default.green(`${snapshotsOutdated} removed`))}, ` : "") + (snapshotsFilesRemoved && !snapshotsDidUpdate ? `${chalk.default.bold(chalk.default.yellow(`${(0, jest_util.pluralize)("file", snapshotsFilesRemoved)} obsolete`))}, ` : "") + (snapshotsFilesRemoved && snapshotsDidUpdate ? `${chalk.default.bold(chalk.default.green(`${(0, jest_util.pluralize)("file", snapshotsFilesRemoved)} removed`))}, ` : "") + (snapshotsUpdated ? `${chalk.default.bold(chalk.default.green(`${snapshotsUpdated} updated`))}, ` : "") + (snapshotsAdded ? `${chalk.default.bold(chalk.default.green(`${snapshotsAdded} written`))}, ` : "") + (snapshotsPassed ? `${chalk.default.bold(chalk.default.green(`${snapshotsPassed} passed`))}, ` : "")}${snapshotsTotal} total`;
|
|
94
|
-
this.info(`
|
|
95
|
-
${chalk.default.bold(`Test result summary:`)}
|
|
96
|
-
${suites}
|
|
97
|
-
${tests}
|
|
98
|
-
${snapshots}
|
|
99
|
-
${chalk.default.bold(`Time:`)} ${(0, jest_util.formatTime)((Date.now() - results.startTime) / 1e3)}
|
|
100
|
-
`);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
//#endregion
|
|
107
|
-
exports.default = plugin;
|
|
108
|
-
exports.plugin = plugin;
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./_virtual/_rolldown/runtime.cjs`);let t=require(`@stryke/path/join`),n=require(`chalk`);n=e.__toESM(n,1);let r=require(`jest`),i=require(`jest-util`);const a=(e={})=>({name:`jest`,async config(){let n={$0:void 0,_:[],coverage:e.codeCoverage,bail:e.bail,cache:!0,cacheDirectory:(0,t.joinPaths)(this.cachePath,`jest`),ci:e.ci,color:e.colors??!0,debug:this.config.mode===`development`,detectOpenHandles:e.detectOpenHandles,forceExit:e.forceExit,logHeapUsage:e.logHeapUsage,detectLeaks:e.detectLeaks,json:e.json,maxWorkers:e.maxWorkers,onlyChanged:e.onlyChanged,changedSince:e.changedSince,outputFile:e.outputFile,passWithNoTests:e.passWithNoTests,runInBand:e.runInBand,showConfig:e.showConfig,silent:e.silent,testLocationInResults:e.testLocationInResults,testNamePattern:e.testNamePattern,testPathPatterns:e.testPathPatterns,testPathIgnorePatterns:e.testPathIgnorePatterns,testTimeout:e.testTimeout,colors:e.colors??!0,verbose:e.verbose,testResultsProcessor:e.testResultsProcessor,updateSnapshot:e.updateSnapshot,useStderr:e.useStderr,watch:e.watch,watchAll:e.watchAll,randomize:e.randomize};if(e.testFile&&n._.push(e.testFile),e.findRelatedTests){let t=e.findRelatedTests.map(e=>e.trim());n._.push(...t),n.findRelatedTests=!0}return e.coverageDirectory&&(n.coverageDirectory=(0,t.joinPaths)(this.config.cwd,e.coverageDirectory)),e.clearCache&&(n.clearCache=!0),e.reporters&&e.reporters.length>0&&(n.reporters=e.reporters),Array.isArray(e.coverageReporters)&&e.coverageReporters.length>0&&(n.coverageReporters=e.coverageReporters),{test:{jest:n}}},async test(){if(this.config.test.jest){let{results:e}=await(0,r.runCLI)(this.config.test.jest,[(0,t.joinPaths)(this.config.cwd,this.config.root)]),a=e.snapshot,o=a.added,s=a.unmatched,c=a.unchecked,l=a.filesRemoved,u=a.didUpdate,d=a.matched,f=a.total,p=a.updated,m=e.numFailedTestSuites,h=e.numPassedTestSuites,g=e.numPendingTestSuites,_=m+h,v=e.testResults.length,y=e.numFailedTests,b=e.numPassedTests,x=e.numPendingTests,S=e.numTodoTests,C=e.numTotalTests,w=`${n.default.bold(`Test Suites: `)+(m?`${n.default.bold(n.default.red(`${m} failed`))}, `:``)+(g?`${n.default.bold(n.default.yellow(`${g} skipped`))}, `:``)+(h?`${n.default.bold(n.default.green(`${h} passed`))}, `:``)+(_===v?v:`${_} of ${v}`)} total`,T=`${n.default.bold(`Tests: `)+(y>0?`${n.default.bold(n.default.red(`${y} failed`))}, `:``)+(x>0?`${n.default.bold(n.default.yellow(`${x} skipped`))}, `:``)+(S>0?`${n.default.bold(n.default.magenta(`${S} todo`))}, `:``)+(b>0?`${n.default.bold(n.default.green(`${b} passed`))}, `:``)}${C} total`,E=`${n.default.bold(`Snapshots: `)+(s?`${n.default.bold(n.default.red(`${s} failed`))}, `:``)+(c&&!u?`${n.default.bold(n.default.yellow(`${c} obsolete`))}, `:``)+(c&&u?`${n.default.bold(n.default.green(`${c} removed`))}, `:``)+(l&&!u?`${n.default.bold(n.default.yellow(`${(0,i.pluralize)(`file`,l)} obsolete`))}, `:``)+(l&&u?`${n.default.bold(n.default.green(`${(0,i.pluralize)(`file`,l)} removed`))}, `:``)+(p?`${n.default.bold(n.default.green(`${p} updated`))}, `:``)+(o?`${n.default.bold(n.default.green(`${o} written`))}, `:``)+(d?`${n.default.bold(n.default.green(`${d} passed`))}, `:``)}${f} total`;this.info(`
|
|
2
|
+
${n.default.bold(`Test result summary:`)}
|
|
3
|
+
${w}
|
|
4
|
+
${T}
|
|
5
|
+
${E}
|
|
6
|
+
${n.default.bold(`Time:`)} ${(0,i.formatTime)((Date.now()-e.startTime)/1e3)}
|
|
7
|
+
`)}}});exports.default=a,exports.plugin=a;
|
package/dist/index.mjs
CHANGED
|
@@ -1,104 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* Jest plugin for Powerlines.
|
|
9
|
-
*
|
|
10
|
-
* @param options - The Jest plugin user configuration options.
|
|
11
|
-
* @returns A Powerlines plugin that integrates Jest testing.
|
|
12
|
-
*/
|
|
13
|
-
const plugin = (options = {}) => {
|
|
14
|
-
return {
|
|
15
|
-
name: "jest",
|
|
16
|
-
async config() {
|
|
17
|
-
const config = {
|
|
18
|
-
$0: void 0,
|
|
19
|
-
_: [],
|
|
20
|
-
coverage: options.codeCoverage,
|
|
21
|
-
bail: options.bail,
|
|
22
|
-
cache: true,
|
|
23
|
-
cacheDirectory: joinPaths(this.cachePath, "jest"),
|
|
24
|
-
ci: options.ci,
|
|
25
|
-
color: options.colors ?? true,
|
|
26
|
-
debug: this.config.mode === "development",
|
|
27
|
-
detectOpenHandles: options.detectOpenHandles,
|
|
28
|
-
forceExit: options.forceExit,
|
|
29
|
-
logHeapUsage: options.logHeapUsage,
|
|
30
|
-
detectLeaks: options.detectLeaks,
|
|
31
|
-
json: options.json,
|
|
32
|
-
maxWorkers: options.maxWorkers,
|
|
33
|
-
onlyChanged: options.onlyChanged,
|
|
34
|
-
changedSince: options.changedSince,
|
|
35
|
-
outputFile: options.outputFile,
|
|
36
|
-
passWithNoTests: options.passWithNoTests,
|
|
37
|
-
runInBand: options.runInBand,
|
|
38
|
-
showConfig: options.showConfig,
|
|
39
|
-
silent: options.silent,
|
|
40
|
-
testLocationInResults: options.testLocationInResults,
|
|
41
|
-
testNamePattern: options.testNamePattern,
|
|
42
|
-
testPathPatterns: options.testPathPatterns,
|
|
43
|
-
testPathIgnorePatterns: options.testPathIgnorePatterns,
|
|
44
|
-
testTimeout: options.testTimeout,
|
|
45
|
-
colors: options.colors ?? true,
|
|
46
|
-
verbose: options.verbose,
|
|
47
|
-
testResultsProcessor: options.testResultsProcessor,
|
|
48
|
-
updateSnapshot: options.updateSnapshot,
|
|
49
|
-
useStderr: options.useStderr,
|
|
50
|
-
watch: options.watch,
|
|
51
|
-
watchAll: options.watchAll,
|
|
52
|
-
randomize: options.randomize
|
|
53
|
-
};
|
|
54
|
-
if (options.testFile) config._.push(options.testFile);
|
|
55
|
-
if (options.findRelatedTests) {
|
|
56
|
-
const parsedTests = options.findRelatedTests.map((s) => s.trim());
|
|
57
|
-
config._.push(...parsedTests);
|
|
58
|
-
config.findRelatedTests = true;
|
|
59
|
-
}
|
|
60
|
-
if (options.coverageDirectory) config.coverageDirectory = joinPaths(this.config.cwd, options.coverageDirectory);
|
|
61
|
-
if (options.clearCache) config.clearCache = true;
|
|
62
|
-
if (options.reporters && options.reporters.length > 0) config.reporters = options.reporters;
|
|
63
|
-
if (Array.isArray(options.coverageReporters) && options.coverageReporters.length > 0) config.coverageReporters = options.coverageReporters;
|
|
64
|
-
return { test: { jest: config } };
|
|
65
|
-
},
|
|
66
|
-
async test() {
|
|
67
|
-
if (this.config.test.jest) {
|
|
68
|
-
const { results } = await runCLI(this.config.test.jest, [joinPaths(this.config.cwd, this.config.root)]);
|
|
69
|
-
const snapshotResults = results.snapshot;
|
|
70
|
-
const snapshotsAdded = snapshotResults.added;
|
|
71
|
-
const snapshotsFailed = snapshotResults.unmatched;
|
|
72
|
-
const snapshotsOutdated = snapshotResults.unchecked;
|
|
73
|
-
const snapshotsFilesRemoved = snapshotResults.filesRemoved;
|
|
74
|
-
const snapshotsDidUpdate = snapshotResults.didUpdate;
|
|
75
|
-
const snapshotsPassed = snapshotResults.matched;
|
|
76
|
-
const snapshotsTotal = snapshotResults.total;
|
|
77
|
-
const snapshotsUpdated = snapshotResults.updated;
|
|
78
|
-
const suitesFailed = results.numFailedTestSuites;
|
|
79
|
-
const suitesPassed = results.numPassedTestSuites;
|
|
80
|
-
const suitesPending = results.numPendingTestSuites;
|
|
81
|
-
const suitesRun = suitesFailed + suitesPassed;
|
|
82
|
-
const suitesTotal = results.testResults.length;
|
|
83
|
-
const testsFailed = results.numFailedTests;
|
|
84
|
-
const testsPassed = results.numPassedTests;
|
|
85
|
-
const testsPending = results.numPendingTests;
|
|
86
|
-
const testsTodo = results.numTodoTests;
|
|
87
|
-
const testsTotal = results.numTotalTests;
|
|
88
|
-
const suites = `${chalk.bold("Test Suites: ") + (suitesFailed ? `${chalk.bold(chalk.red(`${suitesFailed} failed`))}, ` : "") + (suitesPending ? `${chalk.bold(chalk.yellow(`${suitesPending} skipped`))}, ` : "") + (suitesPassed ? `${chalk.bold(chalk.green(`${suitesPassed} passed`))}, ` : "") + (suitesRun !== suitesTotal ? `${suitesRun} of ${suitesTotal}` : suitesTotal)} total`;
|
|
89
|
-
const tests = `${chalk.bold("Tests: ") + (testsFailed > 0 ? `${chalk.bold(chalk.red(`${testsFailed} failed`))}, ` : "") + (testsPending > 0 ? `${chalk.bold(chalk.yellow(`${testsPending} skipped`))}, ` : "") + (testsTodo > 0 ? `${chalk.bold(chalk.magenta(`${testsTodo} todo`))}, ` : "") + (testsPassed > 0 ? `${chalk.bold(chalk.green(`${testsPassed} passed`))}, ` : "")}${testsTotal} total`;
|
|
90
|
-
const snapshots = `${chalk.bold("Snapshots: ") + (snapshotsFailed ? `${chalk.bold(chalk.red(`${snapshotsFailed} failed`))}, ` : "") + (snapshotsOutdated && !snapshotsDidUpdate ? `${chalk.bold(chalk.yellow(`${snapshotsOutdated} obsolete`))}, ` : "") + (snapshotsOutdated && snapshotsDidUpdate ? `${chalk.bold(chalk.green(`${snapshotsOutdated} removed`))}, ` : "") + (snapshotsFilesRemoved && !snapshotsDidUpdate ? `${chalk.bold(chalk.yellow(`${pluralize("file", snapshotsFilesRemoved)} obsolete`))}, ` : "") + (snapshotsFilesRemoved && snapshotsDidUpdate ? `${chalk.bold(chalk.green(`${pluralize("file", snapshotsFilesRemoved)} removed`))}, ` : "") + (snapshotsUpdated ? `${chalk.bold(chalk.green(`${snapshotsUpdated} updated`))}, ` : "") + (snapshotsAdded ? `${chalk.bold(chalk.green(`${snapshotsAdded} written`))}, ` : "") + (snapshotsPassed ? `${chalk.bold(chalk.green(`${snapshotsPassed} passed`))}, ` : "")}${snapshotsTotal} total`;
|
|
91
|
-
this.info(`
|
|
92
|
-
${chalk.bold(`Test result summary:`)}
|
|
93
|
-
${suites}
|
|
94
|
-
${tests}
|
|
95
|
-
${snapshots}
|
|
96
|
-
${chalk.bold(`Time:`)} ${formatTime((Date.now() - results.startTime) / 1e3)}
|
|
97
|
-
`);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
//#endregion
|
|
104
|
-
export { plugin as default, plugin };
|
|
1
|
+
import{joinPaths as e}from"@stryke/path/join";import t from"chalk";import{runCLI as n}from"jest";import{formatTime as r,pluralize as i}from"jest-util";const a=(a={})=>({name:`jest`,async config(){let t={$0:void 0,_:[],coverage:a.codeCoverage,bail:a.bail,cache:!0,cacheDirectory:e(this.cachePath,`jest`),ci:a.ci,color:a.colors??!0,debug:this.config.mode===`development`,detectOpenHandles:a.detectOpenHandles,forceExit:a.forceExit,logHeapUsage:a.logHeapUsage,detectLeaks:a.detectLeaks,json:a.json,maxWorkers:a.maxWorkers,onlyChanged:a.onlyChanged,changedSince:a.changedSince,outputFile:a.outputFile,passWithNoTests:a.passWithNoTests,runInBand:a.runInBand,showConfig:a.showConfig,silent:a.silent,testLocationInResults:a.testLocationInResults,testNamePattern:a.testNamePattern,testPathPatterns:a.testPathPatterns,testPathIgnorePatterns:a.testPathIgnorePatterns,testTimeout:a.testTimeout,colors:a.colors??!0,verbose:a.verbose,testResultsProcessor:a.testResultsProcessor,updateSnapshot:a.updateSnapshot,useStderr:a.useStderr,watch:a.watch,watchAll:a.watchAll,randomize:a.randomize};if(a.testFile&&t._.push(a.testFile),a.findRelatedTests){let e=a.findRelatedTests.map(e=>e.trim());t._.push(...e),t.findRelatedTests=!0}return a.coverageDirectory&&(t.coverageDirectory=e(this.config.cwd,a.coverageDirectory)),a.clearCache&&(t.clearCache=!0),a.reporters&&a.reporters.length>0&&(t.reporters=a.reporters),Array.isArray(a.coverageReporters)&&a.coverageReporters.length>0&&(t.coverageReporters=a.coverageReporters),{test:{jest:t}}},async test(){if(this.config.test.jest){let{results:a}=await n(this.config.test.jest,[e(this.config.cwd,this.config.root)]),o=a.snapshot,s=o.added,c=o.unmatched,l=o.unchecked,u=o.filesRemoved,d=o.didUpdate,f=o.matched,p=o.total,m=o.updated,h=a.numFailedTestSuites,g=a.numPassedTestSuites,_=a.numPendingTestSuites,v=h+g,y=a.testResults.length,b=a.numFailedTests,x=a.numPassedTests,S=a.numPendingTests,C=a.numTodoTests,w=a.numTotalTests,T=`${t.bold(`Test Suites: `)+(h?`${t.bold(t.red(`${h} failed`))}, `:``)+(_?`${t.bold(t.yellow(`${_} skipped`))}, `:``)+(g?`${t.bold(t.green(`${g} passed`))}, `:``)+(v===y?y:`${v} of ${y}`)} total`,E=`${t.bold(`Tests: `)+(b>0?`${t.bold(t.red(`${b} failed`))}, `:``)+(S>0?`${t.bold(t.yellow(`${S} skipped`))}, `:``)+(C>0?`${t.bold(t.magenta(`${C} todo`))}, `:``)+(x>0?`${t.bold(t.green(`${x} passed`))}, `:``)}${w} total`,D=`${t.bold(`Snapshots: `)+(c?`${t.bold(t.red(`${c} failed`))}, `:``)+(l&&!d?`${t.bold(t.yellow(`${l} obsolete`))}, `:``)+(l&&d?`${t.bold(t.green(`${l} removed`))}, `:``)+(u&&!d?`${t.bold(t.yellow(`${i(`file`,u)} obsolete`))}, `:``)+(u&&d?`${t.bold(t.green(`${i(`file`,u)} removed`))}, `:``)+(m?`${t.bold(t.green(`${m} updated`))}, `:``)+(s?`${t.bold(t.green(`${s} written`))}, `:``)+(f?`${t.bold(t.green(`${f} passed`))}, `:``)}${p} total`;this.info(`
|
|
2
|
+
${t.bold(`Test result summary:`)}
|
|
3
|
+
${T}
|
|
4
|
+
${E}
|
|
5
|
+
${D}
|
|
6
|
+
${t.bold(`Time:`)} ${r((Date.now()-a.startTime)/1e3)}
|
|
7
|
+
`)}}});export{a as default,a as plugin};
|
package/dist/types/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export{};
|
package/dist/types/plugin.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export{};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-jest",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.439",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing the Jest testing plugin for Powerlines.",
|
|
6
6
|
"repository": {
|
|
@@ -103,14 +103,14 @@
|
|
|
103
103
|
"@jest/schemas": "30.0.5",
|
|
104
104
|
"@jest/types": "30.3.0",
|
|
105
105
|
"@sinclair/typebox": "^0.34.49",
|
|
106
|
-
"powerlines": "^0.43.
|
|
106
|
+
"powerlines": "^0.43.27"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
109
|
"@jest/types": "30.3.0",
|
|
110
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
110
|
+
"@powerlines/plugin-plugin": "^0.12.382",
|
|
111
111
|
"@types/jest": "^30.0.0"
|
|
112
112
|
},
|
|
113
113
|
"publishConfig": { "access": "public" },
|
|
114
114
|
"types": "./dist/index.d.cts",
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "ad851a239011b884c15b0444db518d74927fd13f"
|
|
116
116
|
}
|