vitest-bats 0.0.1 → 0.0.3
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/index.d.ts +12 -12
- package/package.json +3 -3
- package/runtime.d.ts +6 -7
- package/tsdoc-metadata.json +1 -1
package/index.d.ts
CHANGED
|
@@ -314,7 +314,7 @@ declare const BATS_RESULT_BRAND: unique symbol;
|
|
|
314
314
|
* against it with the `expect.extend` matchers from `vitest-bats/setup`.
|
|
315
315
|
* @public
|
|
316
316
|
*/
|
|
317
|
-
declare class BatsResult {
|
|
317
|
+
export declare class BatsResult {
|
|
318
318
|
/** @internal */
|
|
319
319
|
readonly [BATS_RESULT_BRAND] = true;
|
|
320
320
|
readonly status: number;
|
|
@@ -332,14 +332,14 @@ declare class BatsResult {
|
|
|
332
332
|
* Called automatically between tests by `vitest-bats/setup`'s `beforeEach` hook.
|
|
333
333
|
* @public
|
|
334
334
|
*/
|
|
335
|
-
declare function resetAllBuilders(): void;
|
|
335
|
+
export declare function resetAllBuilders(): void;
|
|
336
336
|
/**
|
|
337
337
|
* Test-writing API returned by a `.sh` import. Configure with `env()`/`flags()`/
|
|
338
338
|
* `mock()`, then terminate with `run(...args)` or `exec(shellExpr)` to get a
|
|
339
339
|
* {@link BatsResult}.
|
|
340
340
|
* @public
|
|
341
341
|
*/
|
|
342
|
-
declare class ScriptBuilder {
|
|
342
|
+
export declare class ScriptBuilder {
|
|
343
343
|
readonly path: string;
|
|
344
344
|
readonly name: string;
|
|
345
345
|
private _env;
|
|
@@ -370,12 +370,12 @@ interface ExecuteOptions {
|
|
|
370
370
|
* Parses the base64-encoded result payload written by the generated BATS test file.
|
|
371
371
|
* @internal
|
|
372
372
|
*/
|
|
373
|
-
declare function parseExecutionResult(recorderDir: string): BatsResultData;
|
|
373
|
+
export declare function parseExecutionResult(recorderDir: string): BatsResultData;
|
|
374
374
|
/**
|
|
375
375
|
* Spawns `bats` against a generated `.bats` file and parses the recorded result.
|
|
376
376
|
* @internal
|
|
377
377
|
*/
|
|
378
|
-
declare function executeBats(opts: ExecuteOptions): BatsResultData;
|
|
378
|
+
export declare function executeBats(opts: ExecuteOptions): BatsResultData;
|
|
379
379
|
//#endregion
|
|
380
380
|
//#region src/bats-generator.d.ts
|
|
381
381
|
/**
|
|
@@ -435,7 +435,7 @@ interface GenerateInput {
|
|
|
435
435
|
* env, recorder, mock shims, kcov), the `run` command, and the base64 result capture.
|
|
436
436
|
* @internal
|
|
437
437
|
*/
|
|
438
|
-
declare function generateBatsFile(input: GenerateInput): string;
|
|
438
|
+
export declare function generateBatsFile(input: GenerateInput): string;
|
|
439
439
|
//#endregion
|
|
440
440
|
//#region src/coverage-reporter.d.ts
|
|
441
441
|
/**
|
|
@@ -455,7 +455,7 @@ interface CoverageThresholds {
|
|
|
455
455
|
* when coverage is enabled.
|
|
456
456
|
* @public
|
|
457
457
|
*/
|
|
458
|
-
declare class BatsCoverageReporter {
|
|
458
|
+
export declare class BatsCoverageReporter {
|
|
459
459
|
private cacheDir;
|
|
460
460
|
private thresholds;
|
|
461
461
|
private statementPassThrough;
|
|
@@ -502,7 +502,7 @@ interface MatcherResult {
|
|
|
502
502
|
* values, and schema validation against a `BatsResult`.
|
|
503
503
|
* @public
|
|
504
504
|
*/
|
|
505
|
-
declare const batsMatchers: {
|
|
505
|
+
export declare const batsMatchers: {
|
|
506
506
|
toSucceed(received: unknown): MatcherResult;
|
|
507
507
|
toFail(received: unknown, code?: number): MatcherResult;
|
|
508
508
|
toHaveOutput(received: unknown, text: string): MatcherResult;
|
|
@@ -623,7 +623,7 @@ interface BatsPluginOptions {
|
|
|
623
623
|
* option handling, matcher setup-file injection, and coverage reporter injection.
|
|
624
624
|
* @public
|
|
625
625
|
*/
|
|
626
|
-
declare function BatsPlugin(options?: BatsPluginOptions): Plugin;
|
|
626
|
+
export declare function BatsPlugin(options?: BatsPluginOptions): Plugin;
|
|
627
627
|
//#endregion
|
|
628
628
|
//#region src/schema.d.ts
|
|
629
629
|
/**
|
|
@@ -643,13 +643,13 @@ type ValidationResult = {
|
|
|
643
643
|
* validation.
|
|
644
644
|
* @internal
|
|
645
645
|
*/
|
|
646
|
-
declare function isStandardSchema(schema: unknown): schema is StandardSchemaV1;
|
|
646
|
+
export declare function isStandardSchema(schema: unknown): schema is StandardSchemaV1;
|
|
647
647
|
/**
|
|
648
648
|
* Validates `value` against a Standard Schema validator or a raw JSON Schema
|
|
649
649
|
* object, backing the `toMatchSchema`/`toMatchJsonSchema` matchers.
|
|
650
650
|
* @internal
|
|
651
651
|
*/
|
|
652
|
-
declare function validate(schema: unknown, value: unknown): ValidationResult;
|
|
652
|
+
export declare function validate(schema: unknown, value: unknown): ValidationResult;
|
|
653
653
|
//#endregion
|
|
654
|
-
export {
|
|
654
|
+
export type { BatsDeps, BatsPluginOptions, BatsResultData, CoverageThresholds, ExecuteOptions, GenerateInput, KcovConfig, KcovOptions, KcovThresholds, LinkFormat, LogLevel, MatcherResult, MockCall, RunMode, StubSpec, ValidationResult };
|
|
655
655
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest-bats",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Test bash scripts with kcov coverage directly in Vitest",
|
|
6
6
|
"keywords": [
|
|
@@ -51,11 +51,11 @@
|
|
|
51
51
|
"@standard-schema/spec": "^1.1.0",
|
|
52
52
|
"ajv": "^8.20.0",
|
|
53
53
|
"ajv-formats": "^3.0.1",
|
|
54
|
-
"fast-xml-parser": "^5.11.
|
|
54
|
+
"fast-xml-parser": "^5.11.2",
|
|
55
55
|
"minimatch": "^10.2.6"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"vitest": "^
|
|
58
|
+
"vitest": "^5.0.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependenciesMeta": {
|
|
61
61
|
"vitest": {
|
package/runtime.d.ts
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
* part of {@link BatsResult.calls}.
|
|
5
5
|
* @public
|
|
6
6
|
*/
|
|
7
|
-
interface MockCall {
|
|
7
|
+
export interface MockCall {
|
|
8
8
|
args: string[];
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* The raw fields decoded from a BATS run, wrapped by the {@link BatsResult} class.
|
|
12
12
|
* @public
|
|
13
13
|
*/
|
|
14
|
-
interface BatsResultData {
|
|
14
|
+
export interface BatsResultData {
|
|
15
15
|
status: number;
|
|
16
16
|
output: string;
|
|
17
17
|
stderr: string;
|
|
@@ -30,14 +30,14 @@ interface BatsResultData {
|
|
|
30
30
|
* graphs (the global symbol registry is process-wide).
|
|
31
31
|
* @internal
|
|
32
32
|
*/
|
|
33
|
-
declare const BATS_RESULT_BRAND: unique symbol;
|
|
33
|
+
export declare const BATS_RESULT_BRAND: unique symbol;
|
|
34
34
|
/**
|
|
35
35
|
* The value returned by `ScriptBuilder.run()`/`.exec()`. Wraps the raw exit status,
|
|
36
36
|
* stdout/stderr (whole and split into lines), and recorded mock calls; assert
|
|
37
37
|
* against it with the `expect.extend` matchers from `vitest-bats/setup`.
|
|
38
38
|
* @public
|
|
39
39
|
*/
|
|
40
|
-
declare class BatsResult {
|
|
40
|
+
export declare class BatsResult {
|
|
41
41
|
/** @internal */
|
|
42
42
|
readonly [BATS_RESULT_BRAND] = true;
|
|
43
43
|
readonly status: number;
|
|
@@ -55,14 +55,14 @@ declare class BatsResult {
|
|
|
55
55
|
* Called automatically between tests by `vitest-bats/setup`'s `beforeEach` hook.
|
|
56
56
|
* @public
|
|
57
57
|
*/
|
|
58
|
-
declare function resetAllBuilders(): void;
|
|
58
|
+
export declare function resetAllBuilders(): void;
|
|
59
59
|
/**
|
|
60
60
|
* Test-writing API returned by a `.sh` import. Configure with `env()`/`flags()`/
|
|
61
61
|
* `mock()`, then terminate with `run(...args)` or `exec(shellExpr)` to get a
|
|
62
62
|
* {@link BatsResult}.
|
|
63
63
|
* @public
|
|
64
64
|
*/
|
|
65
|
-
declare class ScriptBuilder {
|
|
65
|
+
export declare class ScriptBuilder {
|
|
66
66
|
readonly path: string;
|
|
67
67
|
readonly name: string;
|
|
68
68
|
private _env;
|
|
@@ -78,5 +78,4 @@ declare class ScriptBuilder {
|
|
|
78
78
|
private execute;
|
|
79
79
|
}
|
|
80
80
|
//#endregion
|
|
81
|
-
export { BATS_RESULT_BRAND, BatsResult, BatsResultData, MockCall, ScriptBuilder, resetAllBuilders };
|
|
82
81
|
//# sourceMappingURL=runtime.d.ts.map
|