@virmator/plugin-testing 14.32.0 → 14.33.0
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/configs/typedoc.config.ts +1 -1
- package/dist/test-plugin.d.ts +20 -4
- package/dist/test-plugin.js +5 -1
- package/package.json +6 -6
package/dist/test-plugin.d.ts
CHANGED
|
@@ -2,9 +2,17 @@ import { LogOutputType, type MaybePromise, type PartialWithUndefined } from '@au
|
|
|
2
2
|
import { type DirContents } from '@augment-vir/node';
|
|
3
3
|
import { type UniversalTestContext } from '@augment-vir/test';
|
|
4
4
|
import { type VirmatorPlugin } from '@virmator/core';
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Log string transformer.
|
|
7
|
+
*
|
|
8
|
+
* @category Testing
|
|
9
|
+
*/
|
|
6
10
|
export type LogTransform = (logType: LogOutputType, arg: string) => string;
|
|
7
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Results of a plugin test.
|
|
13
|
+
*
|
|
14
|
+
* @category Testing
|
|
15
|
+
*/
|
|
8
16
|
export type TestPluginResult = {
|
|
9
17
|
/**
|
|
10
18
|
* The logs of the plugin execution. Note that this won't catch _all_ logs, as some logged
|
|
@@ -18,7 +26,11 @@ export type TestPluginResult = {
|
|
|
18
26
|
/** Any error that was thrown by the plugin execution. */
|
|
19
27
|
error?: Error;
|
|
20
28
|
};
|
|
21
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* Optional options for {@link testPlugin}.
|
|
31
|
+
*
|
|
32
|
+
* @category Testing
|
|
33
|
+
*/
|
|
22
34
|
export type TestPluginOptions = PartialWithUndefined<{
|
|
23
35
|
/** Transforms the final log string output of a plugin's command. */
|
|
24
36
|
logTransform: LogTransform;
|
|
@@ -27,7 +39,11 @@ export type TestPluginOptions = PartialWithUndefined<{
|
|
|
27
39
|
/** Execute a command before the test directory is cleaned up. */
|
|
28
40
|
beforeCleanupCallback: (cwd: string) => MaybePromise<void>;
|
|
29
41
|
}>;
|
|
30
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* Tests a virmator plugin and saves a snapshot of the results.
|
|
44
|
+
*
|
|
45
|
+
* @category Testing
|
|
46
|
+
*/
|
|
31
47
|
export declare function testPlugin({ shouldPass, context, plugin, cliCommand, cwd, options, }: Readonly<{
|
|
32
48
|
shouldPass: boolean;
|
|
33
49
|
context: UniversalTestContext;
|
package/dist/test-plugin.js
CHANGED
|
@@ -28,7 +28,11 @@ const defaultContentsExcludeList = [
|
|
|
28
28
|
}),
|
|
29
29
|
];
|
|
30
30
|
const defaultLogTransform = (logType, arg) => arg;
|
|
31
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* Tests a virmator plugin and saves a snapshot of the results.
|
|
33
|
+
*
|
|
34
|
+
* @category Testing
|
|
35
|
+
*/
|
|
32
36
|
export async function testPlugin({ shouldPass, context, plugin, cliCommand, cwd, options = {}, }) {
|
|
33
37
|
assertTestContext(context, TestEnv.Node);
|
|
34
38
|
const logs = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@virmator/plugin-testing",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.33.0",
|
|
4
4
|
"description": "Testing for virmator plugins.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"virmator",
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"test:update": "npm test update"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@augment-vir/assert": "^32.2.
|
|
35
|
-
"@augment-vir/common": "^32.2.
|
|
36
|
-
"@augment-vir/node": "^32.2.
|
|
37
|
-
"@augment-vir/test": "^32.2.
|
|
38
|
-
"@virmator/core": "^14.
|
|
34
|
+
"@augment-vir/assert": "^32.2.3",
|
|
35
|
+
"@augment-vir/common": "^32.2.3",
|
|
36
|
+
"@augment-vir/node": "^32.2.3",
|
|
37
|
+
"@augment-vir/test": "^32.2.3",
|
|
38
|
+
"@virmator/core": "^14.33.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/node": "^26.2.0",
|