Skip to content

Commit

Permalink
feat: add "data" property to World interface and variable
Browse files Browse the repository at this point in the history
  • Loading branch information
dnotes committed Dec 14, 2024
1 parent 63e01b5 commit 4ce1543
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/mean-steaks-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"quickpickle": patch
---

added "data" property to World interface and variable
4 changes: 3 additions & 1 deletion packages/main/src/world.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export interface QuickPickleWorldInterface {
isComplete: boolean // (read only) whether the Scenario is on the last step
config: QuickPickleConfig // (read only) configuration for QuickPickle
worldConfig: QuickPickleConfig['worldConfig'] // (read only) configuration for the World
common: Common // Common data shared across tests in one Feature file --- USE SPARINGLY
data: {[key:string]:any} // Data limited to the current Scenario
common: Common // Common data shared across ALL tests in one Feature file --- USE SPARINGLY
init: () => Promise<void> // function called by QuickPickle when the world is created
tagsMatch(tags: string[]): string[]|null // function to check if the Scenario tags match the given tags
}
Expand All @@ -39,6 +40,7 @@ export class QuickPickleWorld implements QuickPickleWorldInterface {
info: QuickPickleWorldInterface['info']
common: QuickPickleWorldInterface['common']
context: TestContext
data = {}
constructor(context:TestContext, info:InfoConstructor) {
this.context = context
this.common = info.common
Expand Down

0 comments on commit 4ce1543

Please sign in to comment.