@step-forge/step-forge 0.0.6 → 0.0.7-beta

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.
Files changed (54) hide show
  1. package/dist/types/src/builderTypeUtils.d.ts +14 -0
  2. package/dist/types/src/common.d.ts +32 -0
  3. package/dist/types/src/given.d.ts +73 -0
  4. package/{src/index.ts → dist/types/src/index.d.ts} +0 -1
  5. package/dist/types/src/then.d.ts +73 -0
  6. package/dist/types/src/utils.d.ts +5 -0
  7. package/dist/types/src/when.d.ts +72 -0
  8. package/dist/types/src/world.d.ts +21 -0
  9. package/package.json +9 -8
  10. package/.eslintignore +0 -6
  11. package/.eslintrc +0 -18
  12. package/.prettierignore +0 -6
  13. package/.prettierrc +0 -15
  14. package/CHANGELOG.md +0 -28
  15. package/cucumber.mjs +0 -38
  16. package/docs/assets/state_deps.gif +0 -0
  17. package/dts-bundle-generator.config.ts +0 -11
  18. package/features/basic.feature +0 -21
  19. package/features/exported.feature +0 -6
  20. package/features/steps/commonSteps.ts +0 -93
  21. package/features/steps/exportedSteps.ts +0 -42
  22. package/features/steps/world.ts +0 -29
  23. package/src/builderTypeUtils.js +0 -2
  24. package/src/builderTypeUtils.js.map +0 -1
  25. package/src/builderTypeUtils.ts +0 -27
  26. package/src/common.js +0 -73
  27. package/src/common.js.map +0 -1
  28. package/src/common.ts +0 -138
  29. package/src/given.js +0 -34
  30. package/src/given.js.map +0 -1
  31. package/src/given.ts +0 -102
  32. package/src/index.js +0 -6
  33. package/src/index.js.map +0 -1
  34. package/src/then.js +0 -34
  35. package/src/then.js.map +0 -1
  36. package/src/then.ts +0 -128
  37. package/src/utils.js +0 -54
  38. package/src/utils.js.map +0 -1
  39. package/src/utils.ts +0 -74
  40. package/src/vite-env.d.ts.old +0 -1
  41. package/src/when.js +0 -34
  42. package/src/when.js.map +0 -1
  43. package/src/when.ts +0 -118
  44. package/src/world.js +0 -51
  45. package/src/world.js.map +0 -1
  46. package/src/world.ts +0 -90
  47. package/test/givenCompilationTests.ts +0 -130
  48. package/test/testUtils.ts +0 -30
  49. package/test/thenCompilationTests.ts +0 -207
  50. package/test/whenCompilationTests.ts +0 -157
  51. package/ts-node-esm-register.js +0 -8
  52. package/tsconfig.cucumber.json +0 -23
  53. package/tsconfig.json +0 -28
  54. package/vite.config.ts +0 -36
package/src/utils.ts DELETED
@@ -1,74 +0,0 @@
1
- import { MergeableWorld } from "./world";
2
-
3
- export const requireFromGiven = <G>(
4
- keys: (keyof G)[],
5
- world: MergeableWorld<G, unknown, unknown>
6
- ) => {
7
- keys.forEach(key => {
8
- if (!world.given[key]) {
9
- throw new Error(`Key ${String(key)} is required in given state`);
10
- }
11
- });
12
- return keys.reduce(
13
- (acc, key) => {
14
- return {
15
- ...acc,
16
- [key]: world.given[key],
17
- };
18
- },
19
- {} as { [key in keyof G]: G[key] }
20
- );
21
- };
22
- export const requireFromWhen = <W>(
23
- keys: (keyof W)[],
24
- world: MergeableWorld<unknown, W, unknown>
25
- ) => {
26
- keys.forEach(key => {
27
- if (!world.when[key]) {
28
- throw new Error(`Key ${String(key)} is required in when state`);
29
- }
30
- });
31
- return keys.reduce(
32
- (acc, key) => {
33
- return {
34
- ...acc,
35
- [key]: world.when[key],
36
- };
37
- },
38
- {} as { [key in keyof W]: W[key] }
39
- );
40
- };
41
- export const requireFromThen = <T>(
42
- keys: (keyof T)[],
43
- world: MergeableWorld<unknown, unknown, T>
44
- ) => {
45
- keys.forEach(key => {
46
- if (!world.then[key]) {
47
- throw new Error(`Key ${String(key)} is required in then state`);
48
- }
49
- });
50
- return keys.reduce(
51
- (acc, key) => {
52
- return {
53
- ...acc,
54
- [key]: world.then[key],
55
- };
56
- },
57
- {} as { [key in keyof T]: T[key] }
58
- );
59
- };
60
-
61
- export const typeCoercer = (value: string) => {
62
- // Try to parse as integer first
63
- const numberValue = parseInt(value, 10);
64
- if (!isNaN(numberValue)) {
65
- return numberValue;
66
- }
67
-
68
- // Check for boolean values
69
- if (value === "true") return true;
70
- if (value === "false") return false;
71
-
72
- // Return original string if no other type matches
73
- return value;
74
- };
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />
package/src/when.js DELETED
@@ -1,34 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import { isString, } from "./builderTypeUtils";
3
- import { addStep } from "./common";
4
- const whenDependencies = (statement, stepType) => (dependencies) => {
5
- const fullDependencies = {
6
- given: dependencies.given ?? {},
7
- when: dependencies.when ?? {},
8
- then: {},
9
- };
10
- return {
11
- step: addStep(statement, stepType, fullDependencies),
12
- };
13
- };
14
- const whenStatement = (stepType) => (statement) => {
15
- let normalizedStatement;
16
- if (isString(statement)) {
17
- normalizedStatement = (() => statement);
18
- }
19
- else {
20
- normalizedStatement = statement;
21
- }
22
- const dependencyFunc = whenDependencies(normalizedStatement, stepType);
23
- const stepFunc = addStep(normalizedStatement, stepType);
24
- return {
25
- dependencies: dependencyFunc,
26
- step: stepFunc,
27
- };
28
- };
29
- export const whenBuilder = () => {
30
- return {
31
- statement: whenStatement("when"),
32
- };
33
- };
34
- //# sourceMappingURL=when.js.map
package/src/when.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"when.js","sourceRoot":"","sources":["when.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,OAAO,EAIL,QAAQ,GAGT,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,MAAM,gBAAgB,GACpB,CAOE,SAAoB,EACpB,QAA0B,EAC1B,EAAE,CACJ,CAGE,YAGD,EAAE,EAAE;IAoBH,MAAM,gBAAgB,GAAiB;QACrC,KAAK,EAAE,YAAY,CAAC,KAAK,IAAK,EAAgB;QAC9C,IAAI,EAAE,YAAY,CAAC,IAAI,IAAK,EAAe;QAC3C,IAAI,EAAE,EAAE;KACT,CAAC;IACF,OAAO;QACL,IAAI,EAAE,OAAO,CAWX,SAAS,EAAE,QAAQ,EAAE,gBAAgB,CAAC;KACzC,CAAC;AACJ,CAAC,CAAC;AAEJ,MAAM,aAAa,GACjB,CACE,QAA0B,EAC1B,EAAE,CACJ,CACE,SAAoB,EACpB,EAAE;IACF,IAAI,mBAES,CAAC;IACd,IAAI,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QACxB,mBAAmB,GAAG,CAAC,GAAG,EAAE,CAAC,SAAS,CAAQ,CAAC;IACjD,CAAC;SAAM,CAAC;QACN,mBAAmB,GAAG,SAAgB,CAAC;IACzC,CAAC;IAID,MAAM,cAAc,GAAG,gBAAgB,CAMrC,mBAAmB,EAAE,QAAQ,CAAC,CAAC;IACjC,MAAM,QAAQ,GAAG,OAAO,CAWtB,mBAAmB,EAAE,QAAQ,CAAC,CAAC;IACjC,OAAO;QACL,YAAY,EAAE,cAAc;QAC5B,IAAI,EAAE,QAAQ;KACf,CAAC;AACJ,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,WAAW,GAAG,GAA0B,EAAE;IACrD,OAAO;QACL,SAAS,EAAE,aAAa,CAAgC,MAAM,CAAC;KAChE,CAAC;AACJ,CAAC,CAAC"}
package/src/when.ts DELETED
@@ -1,118 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
-
3
- import {
4
- EmptyDependencies,
5
- EmptyObject,
6
- GetFunctionArgs,
7
- isString,
8
- RequiredOrOptional,
9
- StepType,
10
- } from "./builderTypeUtils";
11
- import { addStep } from "./common";
12
-
13
- const whenDependencies =
14
- <
15
- Statement extends (...args: any[]) => string,
16
- ResolvedStepType extends StepType,
17
- Variables,
18
- GivenState,
19
- WhenState,
20
- >(
21
- statement: Statement,
22
- stepType: ResolvedStepType
23
- ) =>
24
- <
25
- GivenDeps extends RequiredOrOptional<GivenState>,
26
- WhenDeps extends RequiredOrOptional<WhenState>,
27
- >(dependencies: {
28
- given?: GivenDeps;
29
- when?: WhenDeps;
30
- }) => {
31
- type RestrictedGivenState = {
32
- [K in keyof GivenState as K extends keyof GivenDeps
33
- ? K
34
- : never]: GivenDeps[K] extends "optional"
35
- ? GivenState[K] | undefined
36
- : GivenState[K];
37
- };
38
- type RestrictedWhenState = {
39
- [K in keyof WhenState as K extends keyof WhenDeps
40
- ? K
41
- : never]: WhenDeps[K] extends "optional"
42
- ? WhenState[K] | undefined
43
- : WhenState[K];
44
- };
45
- type Dependencies = {
46
- given: GivenDeps;
47
- when: WhenDeps;
48
- then: EmptyObject;
49
- };
50
- const fullDependencies: Dependencies = {
51
- given: dependencies.given ?? ({} as GivenDeps),
52
- when: dependencies.when ?? ({} as WhenDeps),
53
- then: {},
54
- };
55
- return {
56
- step: addStep<
57
- ResolvedStepType,
58
- Statement,
59
- Dependencies,
60
- Variables,
61
- GivenState,
62
- WhenState,
63
- never,
64
- RestrictedGivenState,
65
- RestrictedWhenState,
66
- never
67
- >(statement, stepType, fullDependencies),
68
- };
69
- };
70
-
71
- const whenStatement =
72
- <ResolvedStepType extends StepType, GivenState, WhenState>(
73
- stepType: ResolvedStepType
74
- ) =>
75
- <Statement extends ((...args: [...any]) => string) | string>(
76
- statement: Statement
77
- ) => {
78
- let normalizedStatement: Statement extends string
79
- ? () => string
80
- : Statement;
81
- if (isString(statement)) {
82
- normalizedStatement = (() => statement) as any;
83
- } else {
84
- normalizedStatement = statement as any;
85
- }
86
- type NormalizedStatement = typeof normalizedStatement;
87
-
88
- type Variables = Statement extends string ? [] : GetFunctionArgs<Statement>;
89
- const dependencyFunc = whenDependencies<
90
- NormalizedStatement,
91
- ResolvedStepType,
92
- Variables,
93
- GivenState,
94
- WhenState
95
- >(normalizedStatement, stepType);
96
- const stepFunc = addStep<
97
- ResolvedStepType,
98
- NormalizedStatement,
99
- EmptyDependencies,
100
- Variables,
101
- GivenState,
102
- WhenState,
103
- never,
104
- never,
105
- never,
106
- never
107
- >(normalizedStatement, stepType);
108
- return {
109
- dependencies: dependencyFunc,
110
- step: stepFunc,
111
- };
112
- };
113
-
114
- export const whenBuilder = <GivenState, WhenState>() => {
115
- return {
116
- statement: whenStatement<"when", GivenState, WhenState>("when"),
117
- };
118
- };
package/src/world.js DELETED
@@ -1,51 +0,0 @@
1
- import _ from "lodash";
2
- function mergeCustomizer(objValue, srcValue) {
3
- if (_.isArray(objValue)) {
4
- return objValue.concat(srcValue);
5
- }
6
- else if (objValue && !_.isPlainObject(objValue) && objValue !== srcValue) {
7
- throw new Error(`Merge would have destroyed previous value ${objValue} with ${srcValue}`);
8
- }
9
- return objValue;
10
- }
11
- export const createMergeableState = (state) => {
12
- return {
13
- ...state,
14
- merge: (newState) => {
15
- state = _.merge({ ...state }, newState, mergeCustomizer);
16
- },
17
- };
18
- };
19
- export class BasicWorld {
20
- givenState = {};
21
- whenState = {};
22
- thenState = {};
23
- get given() {
24
- return {
25
- ...this.givenState,
26
- merge: (newState) => {
27
- this.givenState = _.merge({ ...this.givenState }, newState, mergeCustomizer);
28
- },
29
- };
30
- }
31
- get when() {
32
- return {
33
- ...this.whenState,
34
- merge: (newState) => {
35
- this.whenState = _.merge({ ...this.whenState }, newState, mergeCustomizer);
36
- },
37
- };
38
- }
39
- get then() {
40
- return {
41
- ...this.thenState,
42
- merge: (newState) => {
43
- this.thenState = _.merge({ ...this.thenState }, newState, mergeCustomizer);
44
- },
45
- };
46
- }
47
- }
48
- export const createBasicWorld = () => {
49
- return new BasicWorld();
50
- };
51
- //# sourceMappingURL=world.js.map
package/src/world.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"world.js","sourceRoot":"","sources":["world.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAC;AAUvB,SAAS,eAAe,CAAC,QAAiB,EAAE,QAAiB;IAC3D,IAAI,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACxB,OAAO,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACnC,CAAC;SAAM,IAAI,QAAQ,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC3E,MAAM,IAAI,KAAK,CACb,6CAA6C,QAAQ,SAAS,QAAQ,EAAE,CACzE,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,KAAoB,EACI,EAAE;IAC1B,OAAO;QACL,GAAG,KAAK;QACR,KAAK,EAAE,CAAC,QAAoB,EAAE,EAAE;YAC9B,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,QAAQ,EAAE,eAAe,CAAC,CAAC;QAC3D,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAQF,MAAM,OAAO,UAAU;IACb,UAAU,GAAsB,EAAE,CAAC;IACnC,SAAS,GAAqB,EAAE,CAAC;IACjC,SAAS,GAAqB,EAAE,CAAC;IAEzC,IAAW,KAAK;QACd,OAAO;YACL,GAAG,IAAI,CAAC,UAAU;YAClB,KAAK,EAAE,CAAC,QAAwB,EAAE,EAAE;gBAClC,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,KAAK,CACvB,EAAE,GAAG,IAAI,CAAC,UAAU,EAAE,EACtB,QAAQ,EACR,eAAe,CAChB,CAAC;YACJ,CAAC;SACF,CAAC;IACJ,CAAC;IAED,IAAW,IAAI;QACb,OAAO;YACL,GAAG,IAAI,CAAC,SAAS;YACjB,KAAK,EAAE,CAAC,QAAuB,EAAE,EAAE;gBACjC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,KAAK,CACtB,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,EACrB,QAAQ,EACR,eAAe,CAChB,CAAC;YACJ,CAAC;SACF,CAAC;IACJ,CAAC;IAED,IAAW,IAAI;QACb,OAAO;YACL,GAAG,IAAI,CAAC,SAAS;YACjB,KAAK,EAAE,CAAC,QAAuB,EAAE,EAAE;gBACjC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,KAAK,CACtB,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,EACrB,QAAQ,EACR,eAAe,CAChB,CAAC;YACJ,CAAC;SACF,CAAC;IACJ,CAAC;CACF;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAI9B,EAAE;IACF,OAAO,IAAI,UAAU,EAAqB,CAAC;AAC7C,CAAC,CAAC"}
package/src/world.ts DELETED
@@ -1,90 +0,0 @@
1
- import _ from "lodash";
2
-
3
- export type WorldState<State> = {
4
- readonly [K in keyof State]?: State[K];
5
- };
6
-
7
- export type MergeableWorldState<T> = WorldState<T> & {
8
- merge: (newState: Partial<T>) => void;
9
- };
10
-
11
- function mergeCustomizer(objValue: unknown, srcValue: unknown) {
12
- if (_.isArray(objValue)) {
13
- return objValue.concat(srcValue);
14
- } else if (objValue && !_.isPlainObject(objValue) && objValue !== srcValue) {
15
- throw new Error(
16
- `Merge would have destroyed previous value ${objValue} with ${srcValue}`
17
- );
18
- }
19
- return objValue;
20
- }
21
-
22
- export const createMergeableState = <T>(
23
- state: WorldState<T>
24
- ): MergeableWorldState<T> => {
25
- return {
26
- ...state,
27
- merge: (newState: Partial<T>) => {
28
- state = _.merge({ ...state }, newState, mergeCustomizer);
29
- },
30
- };
31
- };
32
-
33
- export type MergeableWorld<Given, When, Then> = {
34
- given: MergeableWorldState<Given>;
35
- when: MergeableWorldState<When>;
36
- then: MergeableWorldState<Then>;
37
- };
38
-
39
- export class BasicWorld<Given, When, Then> {
40
- private givenState: WorldState<Given> = {};
41
- private whenState: WorldState<When> = {};
42
- private thenState: WorldState<Then> = {};
43
-
44
- public get given(): MergeableWorldState<Given> {
45
- return {
46
- ...this.givenState,
47
- merge: (newState: Partial<Given>) => {
48
- this.givenState = _.merge(
49
- { ...this.givenState },
50
- newState,
51
- mergeCustomizer
52
- );
53
- },
54
- };
55
- }
56
-
57
- public get when(): MergeableWorldState<When> {
58
- return {
59
- ...this.whenState,
60
- merge: (newState: Partial<When>) => {
61
- this.whenState = _.merge(
62
- { ...this.whenState },
63
- newState,
64
- mergeCustomizer
65
- );
66
- },
67
- };
68
- }
69
-
70
- public get then(): MergeableWorldState<Then> {
71
- return {
72
- ...this.thenState,
73
- merge: (newState: Partial<Then>) => {
74
- this.thenState = _.merge(
75
- { ...this.thenState },
76
- newState,
77
- mergeCustomizer
78
- );
79
- },
80
- };
81
- }
82
- }
83
-
84
- export const createBasicWorld = <Given, When, Then>(): MergeableWorld<
85
- Given,
86
- When,
87
- Then
88
- > => {
89
- return new BasicWorld<Given, When, Then>();
90
- };
@@ -1,130 +0,0 @@
1
- import { givenBuilder } from "../src/given";
2
- import { SampleGivenState } from "./testUtils";
3
-
4
- // Simplest possible example
5
- givenBuilder<SampleGivenState>()
6
- .statement("Given a user")
7
- .step(() => {
8
- return {
9
- a: "user",
10
- };
11
- });
12
-
13
- // Simple dependency example
14
- givenBuilder<SampleGivenState>()
15
- .statement("Given a user")
16
- .dependencies({
17
- given: {
18
- a: "required",
19
- },
20
- })
21
- .step(({ given }) => {
22
- return {
23
- b: `I love ${given.a}`,
24
- };
25
- });
26
-
27
- // Simple variables example
28
- givenBuilder<SampleGivenState>()
29
- .statement((v1: string, v2: number) => `Given a user ${v1} ${v2}`)
30
- .step(({ variables: [v1, v2] }) => {
31
- return {
32
- b: `I love ${v1} ${v2}`,
33
- };
34
- });
35
-
36
- // Complex example
37
- givenBuilder<SampleGivenState>()
38
- .statement((v1: string, v2: number) => `Given a user ${v1} ${v2}`)
39
- .dependencies({
40
- given: {
41
- a: "required",
42
- b: "optional",
43
- c: "required",
44
- },
45
- })
46
- .step(({ variables: [v1, v2], given: { a, b, c } }) => {
47
- return {
48
- b: `I love ${v1} ${v2} ${a} ${b} ${c}`,
49
- };
50
- });
51
-
52
- // ----- Should not compile section ----
53
-
54
- // @ts-expect-error - Should not compile without a statement
55
- givenBuilder<SampleGivenState>().step(() => {
56
- return {
57
- a: "user",
58
- };
59
- });
60
-
61
- givenBuilder<SampleGivenState>()
62
- .statement(() => "Given a user")
63
- // @ts-expect-error - Should not compile since no variables are declared
64
- .step(({ variables: [v1, v2] }) => {
65
- return {
66
- a: `I love ${v1} ${v2}`,
67
- };
68
- });
69
-
70
- // TODO: Currently resolves variables to `any[]` which is incorrect
71
- givenBuilder<SampleGivenState>()
72
- .statement("Given a user")
73
- // @ts-expect-error - Should not compile since no variables are declared
74
- .step(({ variables: [v1, v2] }) => {
75
- return {
76
- a: `I love ${v1} ${v2}`,
77
- };
78
- });
79
-
80
- givenBuilder<SampleGivenState>()
81
- .statement(
82
- (v1: string, v2: number, v3: boolean) => `Given a user ${v1} ${v2} ${v3}`
83
- )
84
- // @ts-expect-error - Should not compile since the number of variables exceeds the number declared
85
- .step(({ variables: [v1, v2, v3, v4] }) => {
86
- return {
87
- a: `I love ${v1} ${v2} ${v3} ${v4}`,
88
- };
89
- });
90
-
91
- givenBuilder<SampleGivenState>()
92
- .statement("Given a user")
93
- .dependencies({ given: { a: "required" } })
94
- .step(({ given }) => {
95
- return {
96
- // @ts-expect-error - Should not compile if we attempt to access a part of state that was not declared as a dependency
97
- b: `I love ${given.b}`,
98
- };
99
- });
100
-
101
- givenBuilder<SampleGivenState>()
102
- .statement("a user")
103
- // @ts-expect-error - Should not compile if we attempt to access a part of state that was not declared as a dependency
104
- .dependencies({ when: { a: "required" } })
105
- .step(({ when }) => {
106
- return {
107
- // @ts-expect-error - Should not compile if we attempt to access a part of state that was not declared as a dependency
108
- b: `I love ${when.c}`,
109
- };
110
- });
111
-
112
- givenBuilder<SampleGivenState>()
113
- .statement("Given a user")
114
- .dependencies({ given: { a: "optional" } })
115
- .step(({ given }) => {
116
- // @ts-expect-error - Should not compile since a is optional and can be undefined
117
- const strictA: string = given.a;
118
- return {
119
- b: `I love ${strictA}`,
120
- };
121
- });
122
-
123
- givenBuilder<SampleGivenState>()
124
- .statement("Given a user")
125
- // @ts-expect-error - Should not compile since the return type is not a partial of given state
126
- .step(() => {
127
- return {
128
- f: "hello",
129
- };
130
- });
package/test/testUtils.ts DELETED
@@ -1,30 +0,0 @@
1
- import { createBasicWorld } from "../src/world";
2
-
3
- export const sampleGivenState = {
4
- a: "stuff",
5
- b: "things",
6
- c: 3,
7
- };
8
- export type SampleGivenState = typeof sampleGivenState;
9
-
10
- export const sampleWhenState = {
11
- d: 1,
12
- e: "other stuff",
13
- f: [3, 4, 5],
14
- };
15
- export type SampleWhenState = typeof sampleWhenState;
16
-
17
- export const sampleThenState = {
18
- g: 1,
19
- h: 2,
20
- i: { j: "k" },
21
- };
22
- export type SampleThenState = typeof sampleThenState;
23
-
24
- export const sampleWorld = createBasicWorld<
25
- SampleGivenState,
26
- SampleWhenState,
27
- SampleThenState
28
- >();
29
-
30
- export type SampleWorld = typeof sampleWorld;