@augment-vir/test 30.0.2 → 30.0.4
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UniversalTestContext } from './universal-test-context.js';
|
|
2
2
|
/**
|
|
3
3
|
* An interface for an {@link it} callback. Used in {@link UniversalBareIt}.
|
|
4
4
|
*
|
|
@@ -10,7 +10,7 @@ import { UniversalContext } from './universal-test-context.js';
|
|
|
10
10
|
* @category Package : @augment-vir/test
|
|
11
11
|
* @package [`@augment-vir/test`](https://www.npmjs.com/package/@augment-vir/test)
|
|
12
12
|
*/
|
|
13
|
-
export type UniversalItCallback = (this: void, context:
|
|
13
|
+
export type UniversalItCallback = (this: void, context: UniversalTestContext) => Promise<void> | void;
|
|
14
14
|
/**
|
|
15
15
|
* A minimal interface for {@link it}. This is used in {@link UniversalIt}.
|
|
16
16
|
*
|
|
@@ -29,7 +29,7 @@ export type NodeTestContext = NodeTestContextImport;
|
|
|
29
29
|
* @category Package : @augment-vir/test
|
|
30
30
|
* @package [`@augment-vir/test`](https://www.npmjs.com/package/@augment-vir/test)
|
|
31
31
|
*/
|
|
32
|
-
export type
|
|
32
|
+
export type UniversalTestContext = NodeTestContext | MochaTestContext;
|
|
33
33
|
/**
|
|
34
34
|
* Test context by runtime env when [Node.js's test runner](https://nodejs.org/api/test.html) is
|
|
35
35
|
* used for Node tests and [web-test-runner](https://modern-web.dev/docs/test-runner/overview/) is
|
|
@@ -50,7 +50,7 @@ export type ContextByEnv = {
|
|
|
50
50
|
* @category Package : @augment-vir/test
|
|
51
51
|
* @package [`@augment-vir/test`](https://www.npmjs.com/package/@augment-vir/test)
|
|
52
52
|
*/
|
|
53
|
-
export declare function ensureTestContext<const SpecificEnv extends RuntimeEnv>(context:
|
|
53
|
+
export declare function ensureTestContext<const SpecificEnv extends RuntimeEnv>(context: UniversalTestContext, env: RuntimeEnv): ContextByEnv[SpecificEnv];
|
|
54
54
|
/**
|
|
55
55
|
* Asserts that the given context is for the given env, otherwise throws an Error.
|
|
56
56
|
*
|
|
@@ -58,7 +58,7 @@ export declare function ensureTestContext<const SpecificEnv extends RuntimeEnv>(
|
|
|
58
58
|
* @category Package : @augment-vir/test
|
|
59
59
|
* @package [`@augment-vir/test`](https://www.npmjs.com/package/@augment-vir/test)
|
|
60
60
|
*/
|
|
61
|
-
export declare function assertTestContext<const SpecificEnv extends RuntimeEnv>(context:
|
|
61
|
+
export declare function assertTestContext<const SpecificEnv extends RuntimeEnv>(context: UniversalTestContext, env: RuntimeEnv): asserts context is ContextByEnv[SpecificEnv];
|
|
62
62
|
/**
|
|
63
63
|
* Checks that the given context is for the given env.
|
|
64
64
|
*
|
|
@@ -66,7 +66,7 @@ export declare function assertTestContext<const SpecificEnv extends RuntimeEnv>(
|
|
|
66
66
|
* @category Package : @augment-vir/test
|
|
67
67
|
* @package [`@augment-vir/test`](https://www.npmjs.com/package/@augment-vir/test)
|
|
68
68
|
*/
|
|
69
|
-
export declare function isTestContext<const SpecificEnv extends RuntimeEnv>(context:
|
|
69
|
+
export declare function isTestContext<const SpecificEnv extends RuntimeEnv>(context: UniversalTestContext, env: RuntimeEnv): context is ContextByEnv[SpecificEnv];
|
|
70
70
|
/**
|
|
71
71
|
* Determine the env for the given test context.
|
|
72
72
|
*
|
|
@@ -74,4 +74,4 @@ export declare function isTestContext<const SpecificEnv extends RuntimeEnv>(cont
|
|
|
74
74
|
* @category Package : @augment-vir/test
|
|
75
75
|
* @package [`@augment-vir/test`](https://www.npmjs.com/package/@augment-vir/test)
|
|
76
76
|
*/
|
|
77
|
-
export declare function determineTestContextEnv(context:
|
|
77
|
+
export declare function determineTestContextEnv(context: UniversalTestContext): RuntimeEnv;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@augment-vir/test",
|
|
3
|
-
"version": "30.0.
|
|
3
|
+
"version": "30.0.4",
|
|
4
4
|
"description": "A universal testing suite that works with Mocha style test runners _and_ Node.js's built-in test runner.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"test",
|
|
@@ -42,18 +42,18 @@
|
|
|
42
42
|
"test:web": "virmator test --no-deps web 'src/test-web/**/*.test.ts'"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@augment-vir/assert": "^30.0.
|
|
46
|
-
"@augment-vir/common": "^30.0.
|
|
45
|
+
"@augment-vir/assert": "^30.0.4",
|
|
46
|
+
"@augment-vir/common": "^30.0.4",
|
|
47
47
|
"@open-wc/testing-helpers": "^3.0.1",
|
|
48
48
|
"type-fest": "^4.26.1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@types/node": "^22.5.
|
|
51
|
+
"@types/node": "^22.5.5",
|
|
52
52
|
"@web/dev-server-esbuild": "^1.0.2",
|
|
53
53
|
"@web/test-runner": "^0.19.0",
|
|
54
54
|
"@web/test-runner-commands": "^0.9.0",
|
|
55
55
|
"@web/test-runner-playwright": "^0.11.0",
|
|
56
|
-
"concurrently": "^9.0.
|
|
56
|
+
"concurrently": "^9.0.1",
|
|
57
57
|
"element-vir": "^22.2.2",
|
|
58
58
|
"istanbul-smart-text-reporter": "^1.1.4",
|
|
59
59
|
"typescript": "^5.6.2"
|