@virmator/plugin-testing 14.6.1 → 14.7.1
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/test-plugin.js +17 -4
- package/package.json +2 -2
package/dist/test-plugin.js
CHANGED
|
@@ -5,7 +5,10 @@ import { executeVirmatorCommand, findClosestPackageDir, hideNoTraceTraces, Virma
|
|
|
5
5
|
import { relative, sep } from 'node:path';
|
|
6
6
|
import { monoRepoDir } from './file-paths.js';
|
|
7
7
|
function handleWrite(logs, logType, text) {
|
|
8
|
-
const fixed = removeColor(text).replaceAll(addSuffix({
|
|
8
|
+
const fixed = removeColor(text).replaceAll(addSuffix({
|
|
9
|
+
value: monoRepoDir,
|
|
10
|
+
suffix: '/',
|
|
11
|
+
}), '');
|
|
9
12
|
if (fixed.length) {
|
|
10
13
|
getOrSet(logs, logType, () => []).push(fixed);
|
|
11
14
|
}
|
|
@@ -13,10 +16,16 @@ function handleWrite(logs, logType, text) {
|
|
|
13
16
|
}
|
|
14
17
|
const defaultContentsExcludeList = [
|
|
15
18
|
'tsconfig.tsbuildinfo',
|
|
16
|
-
wrapString({
|
|
19
|
+
wrapString({
|
|
20
|
+
value: 'node_modules',
|
|
21
|
+
wrapper: sep,
|
|
22
|
+
}),
|
|
17
23
|
`.git`,
|
|
18
24
|
'package-lock.json',
|
|
19
|
-
wrapString({
|
|
25
|
+
wrapString({
|
|
26
|
+
value: 'coverage',
|
|
27
|
+
wrapper: sep,
|
|
28
|
+
}),
|
|
20
29
|
];
|
|
21
30
|
/** Tests a virmator plugin and saves a snapshot of the results. */
|
|
22
31
|
export async function testPlugin(shouldPass, context, plugin, cliCommand, cwd, { excludeContents = [], logTransform = (type, arg) => arg, beforeCleanupCallback, } = {}) {
|
|
@@ -72,7 +81,11 @@ export async function testPlugin(shouldPass, context, plugin, cliCommand, cwd, {
|
|
|
72
81
|
}),
|
|
73
82
|
cwd: toPosixPath(relative(monoRepoDir, cwd)),
|
|
74
83
|
contentsDiff,
|
|
75
|
-
...(error
|
|
84
|
+
...(error
|
|
85
|
+
? {
|
|
86
|
+
error,
|
|
87
|
+
}
|
|
88
|
+
: {}),
|
|
76
89
|
};
|
|
77
90
|
context.assert.snapshot(result);
|
|
78
91
|
if (shouldPass && error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@virmator/plugin-testing",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.7.1",
|
|
4
4
|
"description": "Testing for virmator plugins.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"virmator",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@augment-vir/common": "^31.64.0",
|
|
36
36
|
"@augment-vir/node": "^31.64.0",
|
|
37
37
|
"@augment-vir/test": "^31.64.0",
|
|
38
|
-
"@virmator/core": "^14.
|
|
38
|
+
"@virmator/core": "^14.7.1",
|
|
39
39
|
"type-fest": "^5.4.4"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|