@appthrust/kest 0.1.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/LICENSE +21 -0
- package/README.md +412 -0
- package/example/config-map.yaml +6 -0
- package/example/example-report.md +744 -0
- package/example/example.test.ts +225 -0
- package/example/hello-world-crd.yaml +145 -0
- package/package.json +62 -0
- package/ts/actions/apply-namespace.ts +29 -0
- package/ts/actions/apply-status.ts +23 -0
- package/ts/actions/apply.ts +25 -0
- package/ts/actions/assert-list.ts +63 -0
- package/ts/actions/assert.ts +34 -0
- package/ts/actions/exec.ts +21 -0
- package/ts/actions/get.ts +40 -0
- package/ts/actions/types.ts +48 -0
- package/ts/apis/index.ts +788 -0
- package/ts/bdd/index.ts +30 -0
- package/ts/duration/index.ts +171 -0
- package/ts/index.ts +3 -0
- package/ts/k8s-resource/index.ts +120 -0
- package/ts/kubectl/index.ts +351 -0
- package/ts/recording/index.ts +134 -0
- package/ts/reporter/index.ts +0 -0
- package/ts/reporter/interface.ts +5 -0
- package/ts/reporter/markdown.ts +962 -0
- package/ts/retry.ts +112 -0
- package/ts/reverting/index.ts +36 -0
- package/ts/scenario/index.ts +220 -0
- package/ts/test.ts +127 -0
- package/ts/workspace/find-up.ts +20 -0
- package/ts/workspace/index.ts +25 -0
- package/ts/yaml/index.ts +14 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Kubectl } from "../kubectl";
|
|
2
|
+
|
|
3
|
+
export type Revert = () => Promise<void>;
|
|
4
|
+
|
|
5
|
+
export interface MutateDef<Input, Output> {
|
|
6
|
+
readonly type: "mutate";
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly mutate: Mutate<Input, Output>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type Mutate<Input, Output> = (
|
|
12
|
+
deps: Deps
|
|
13
|
+
) => (input: Input) => Promise<MutateResult<Output>>;
|
|
14
|
+
|
|
15
|
+
export interface MutateResult<Output> {
|
|
16
|
+
readonly revert: Revert;
|
|
17
|
+
readonly output: Output;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A mutate-like action that does not register any revert.
|
|
22
|
+
*
|
|
23
|
+
* Useful for operations that are hard (or impossible) to revert reliably,
|
|
24
|
+
* e.g. applying the `status` subresource.
|
|
25
|
+
*/
|
|
26
|
+
export interface OneWayMutateDef<Input, Output> {
|
|
27
|
+
readonly type: "oneWayMutate";
|
|
28
|
+
readonly name: string;
|
|
29
|
+
readonly mutate: OneWayMutate<Input, Output>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type OneWayMutate<Input, Output> = (
|
|
33
|
+
deps: Deps
|
|
34
|
+
) => (input: Input) => Promise<Output>;
|
|
35
|
+
|
|
36
|
+
export interface QueryDef<Input, Output> {
|
|
37
|
+
readonly type: "query";
|
|
38
|
+
readonly name: string;
|
|
39
|
+
readonly query: Query<Input, Output>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export type Query<Input, Output> = (
|
|
43
|
+
deps: Deps
|
|
44
|
+
) => (input: Input) => Promise<Output>;
|
|
45
|
+
|
|
46
|
+
export interface Deps {
|
|
47
|
+
readonly kubectl: Kubectl;
|
|
48
|
+
}
|