@autometa/coordinator 0.1.3 → 0.1.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,12 +1,12 @@
1
1
 
2
- > @autometa/coordinator@0.1.1 test /Users/ben.aherne/Documents/GitHub/autometa/packages/coordinator
2
+ > @autometa/coordinator@0.1.3 test /Users/ben.aherne/Documents/GitHub/autometa/packages/coordinator
3
3
  > vitest run --passWithNoTests
4
4
 
5
5
 
6
6
  RUN v0.29.8 /Users/ben.aherne/Documents/GitHub/autometa/packages/coordinator
7
7
 
8
- No test files found, exiting with code 0
9
-
10
8
  include: **/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}
11
9
  exclude: **/node_modules/**, **/dist/**, **/cypress/**, **/.{idea,git,cache,output,temp}/**, **/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*
12
10
  watch exclude: **/node_modules/**, **/dist/**
11
+ No test files found, exiting with code 0
12
+
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @autometa/coordinator
2
2
 
3
+ ## 0.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - e243e8b4: fix: globally scoped hooks not executing
8
+ - Updated dependencies [e243e8b4]
9
+ - @autometa/jest-executor@0.1.4
10
+ - @autometa/test-builder@0.1.4
11
+ - @autometa/scopes@0.2.4
12
+ - @autometa/gherkin@0.4.2
13
+ - @autometa/events@0.1.2
14
+
3
15
  ## 0.1.3
4
16
 
5
17
  ### Patch Changes
package/dist/esm/index.js CHANGED
@@ -54,7 +54,7 @@ var Coordinator = class {
54
54
  __privateSet(this, _builder, new TestBuilder(gherkin));
55
55
  __privateSet(this, _bridge, __privateGet(this, _builder).onFeatureExecuted(feature));
56
56
  const { app, world } = this.opts[this.config.environment ?? "default"];
57
- executor({ app, world }, __privateGet(this, _bridge), events, this.configs);
57
+ executor({ app, world }, this.global, __privateGet(this, _bridge), events, this.configs);
58
58
  }
59
59
  get fs() {
60
60
  if (!__privateGet(this, _fs)) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/coordinator.ts"],"sourcesContent":["import { Config } from \"@autometa/config\";\nimport { FeatureBridge, TestBuilder } from \"@autometa/test-builder\";\nimport { AutometaApp, AutometaWorld } from \"@autometa/app\";\nimport { TestEventEmitter } from \"@autometa/events\";\nimport { Class } from \"@autometa/types\";\nimport { FeatureScope, Files, GlobalScope } from \"@autometa/scopes\";\nimport { AutomationError } from \"@autometa/errors\";\nimport { AssertDefined } from \"@autometa/asserters\";\nimport { CoordinatorOpts } from \"./types\";\nimport { Feature } from \"@autometa/gherkin\";\nexport class Coordinator {\n #fs: Files;\n #builder: TestBuilder;\n #bridge: FeatureBridge;\n constructor(\n readonly global: GlobalScope,\n readonly configs: Config,\n readonly opts: Record<string, CoordinatorOpts>\n ) {\n AssertDefined(configs, \"Config\");\n }\n\n run(\n feature: FeatureScope,\n caller: string,\n events: TestEventEmitter,\n executor: (\n { app, world }: { app: Class<AutometaApp>; world: Class<AutometaWorld> },\n bridge: FeatureBridge,\n events: TestEventEmitter,\n config: Config\n ) => void\n ) {\n AssertDefined(executor, \"Executor\");\n\n const fs = this.fileSystem(caller);\n const path = fs.fromUrlPattern(feature.path);\n path.loadApps();\n\n const gherkin = path.getFeatureFile();\n if (!Array.isArray(gherkin)) {\n this.start(gherkin, feature, events, executor);\n } else {\n for (const featGherkin of gherkin) {\n this.start(featGherkin, feature, events, executor);\n }\n }\n }\n\n private start(\n gherkin: Feature,\n feature: FeatureScope,\n events: TestEventEmitter,\n executor: (\n { app, world }: { app: Class<AutometaApp>; world: Class<AutometaWorld> },\n bridge: FeatureBridge,\n events: TestEventEmitter,\n config: Config\n ) => void\n ) {\n this.global.unlock();\n this.loadSteps();\n this.global.lock();\n this.#builder = new TestBuilder(gherkin);\n this.#bridge = this.#builder.onFeatureExecuted(feature);\n const { app, world } = this.opts[this.config.environment ?? \"default\"];\n executor({ app, world }, this.#bridge, events, this.configs);\n }\n\n get fs() {\n if (!this.#fs) {\n throw new AutomationError(\"File System not initialized\");\n }\n return this.#fs;\n }\n\n get config() {\n return this.configs.current;\n }\n\n fileSystem(caller: string) {\n const { roots } = this.config;\n const { steps, features, app } = roots;\n\n this.#fs = new Files()\n .withFeatureRoot(features)\n .withCallerFile(caller)\n .withStepsRoot(steps)\n .withAppRoot(app);\n return this.fs;\n }\n\n loadSteps() {\n const { steps } = this.config.roots;\n if (typeof steps === \"string\") {\n this.fs.fromUrlPattern(steps).loadStepDefinitions();\n return;\n }\n for (const stepRoot of steps) {\n this.fs.fromUrlPattern(stepRoot).loadStepDefinitions();\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,SAAwB,mBAAmB;AAI3C,SAAuB,aAA0B;AACjD,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAP9B;AAUO,IAAM,cAAN,MAAkB;AAAA,EAIvB,YACW,QACA,SACA,MACT;AAHS;AACA;AACA;AANX;AACA;AACA;AAME,kBAAc,SAAS,QAAQ;AAAA,EACjC;AAAA,EAEA,IACE,SACA,QACA,QACA,UAMA;AACA,kBAAc,UAAU,UAAU;AAElC,UAAM,KAAK,KAAK,WAAW,MAAM;AACjC,UAAM,OAAO,GAAG,eAAe,QAAQ,IAAI;AAC3C,SAAK,SAAS;AAEd,UAAM,UAAU,KAAK,eAAe;AACpC,QAAI,CAAC,MAAM,QAAQ,OAAO,GAAG;AAC3B,WAAK,MAAM,SAAS,SAAS,QAAQ,QAAQ;AAAA,IAC/C,OAAO;AACL,iBAAW,eAAe,SAAS;AACjC,aAAK,MAAM,aAAa,SAAS,QAAQ,QAAQ;AAAA,MACnD;AAAA,IACF;AAAA,EACF;AAAA,EAEQ,MACN,SACA,SACA,QACA,UAMA;AACA,SAAK,OAAO,OAAO;AACnB,SAAK,UAAU;AACf,SAAK,OAAO,KAAK;AACjB,uBAAK,UAAW,IAAI,YAAY,OAAO;AACvC,uBAAK,SAAU,mBAAK,UAAS,kBAAkB,OAAO;AACtD,UAAM,EAAE,KAAK,MAAM,IAAI,KAAK,KAAK,KAAK,OAAO,eAAe,SAAS;AACrE,aAAS,EAAE,KAAK,MAAM,GAAG,mBAAK,UAAS,QAAQ,KAAK,OAAO;AAAA,EAC7D;AAAA,EAEA,IAAI,KAAK;AACP,QAAI,CAAC,mBAAK,MAAK;AACb,YAAM,IAAI,gBAAgB,6BAA6B;AAAA,IACzD;AACA,WAAO,mBAAK;AAAA,EACd;AAAA,EAEA,IAAI,SAAS;AACX,WAAO,KAAK,QAAQ;AAAA,EACtB;AAAA,EAEA,WAAW,QAAgB;AACzB,UAAM,EAAE,MAAM,IAAI,KAAK;AACvB,UAAM,EAAE,OAAO,UAAU,IAAI,IAAI;AAEjC,uBAAK,KAAM,IAAI,MAAM,EAClB,gBAAgB,QAAQ,EACxB,eAAe,MAAM,EACrB,cAAc,KAAK,EACnB,YAAY,GAAG;AAClB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,YAAY;AACV,UAAM,EAAE,MAAM,IAAI,KAAK,OAAO;AAC9B,QAAI,OAAO,UAAU,UAAU;AAC7B,WAAK,GAAG,eAAe,KAAK,EAAE,oBAAoB;AAClD;AAAA,IACF;AACA,eAAW,YAAY,OAAO;AAC5B,WAAK,GAAG,eAAe,QAAQ,EAAE,oBAAoB;AAAA,IACvD;AAAA,EACF;AACF;AA3FE;AACA;AACA;","names":[]}
1
+ {"version":3,"sources":["../../src/coordinator.ts"],"sourcesContent":["import { Config } from \"@autometa/config\";\nimport { FeatureBridge, TestBuilder } from \"@autometa/test-builder\";\nimport { AutometaApp, AutometaWorld } from \"@autometa/app\";\nimport { TestEventEmitter } from \"@autometa/events\";\nimport { Class } from \"@autometa/types\";\nimport { FeatureScope, Files, GlobalScope } from \"@autometa/scopes\";\nimport { AutomationError } from \"@autometa/errors\";\nimport { AssertDefined } from \"@autometa/asserters\";\nimport { CoordinatorOpts } from \"./types\";\nimport { Feature } from \"@autometa/gherkin\";\nexport class Coordinator {\n #fs: Files;\n #builder: TestBuilder;\n #bridge: FeatureBridge;\n constructor(\n readonly global: GlobalScope,\n readonly configs: Config,\n readonly opts: Record<string, CoordinatorOpts>\n ) {\n AssertDefined(configs, \"Config\");\n }\n\n run(\n feature: FeatureScope,\n caller: string,\n events: TestEventEmitter,\n executor: (\n { app, world }: { app: Class<AutometaApp>; world: Class<AutometaWorld> },\n global: GlobalScope,\n bridge: FeatureBridge,\n events: TestEventEmitter,\n config: Config\n ) => void\n ) {\n AssertDefined(executor, \"Executor\");\n\n const fs = this.fileSystem(caller);\n const path = fs.fromUrlPattern(feature.path);\n path.loadApps();\n\n const gherkin = path.getFeatureFile();\n if (!Array.isArray(gherkin)) {\n this.start(gherkin, feature, events, executor);\n } else {\n for (const featGherkin of gherkin) {\n this.start(featGherkin, feature, events, executor);\n }\n }\n }\n\n private start(\n gherkin: Feature,\n feature: FeatureScope,\n events: TestEventEmitter,\n executor: (\n { app, world }: { app: Class<AutometaApp>; world: Class<AutometaWorld> },\n global: GlobalScope,\n bridge: FeatureBridge,\n events: TestEventEmitter,\n config: Config\n ) => void\n ) {\n this.global.unlock();\n this.loadSteps();\n this.global.lock();\n this.#builder = new TestBuilder(gherkin);\n this.#bridge = this.#builder.onFeatureExecuted(feature);\n const { app, world } = this.opts[this.config.environment ?? \"default\"];\n executor({ app, world }, this.global, this.#bridge, events, this.configs);\n }\n\n get fs() {\n if (!this.#fs) {\n throw new AutomationError(\"File System not initialized\");\n }\n return this.#fs;\n }\n\n get config() {\n return this.configs.current;\n }\n\n fileSystem(caller: string) {\n const { roots } = this.config;\n const { steps, features, app } = roots;\n\n this.#fs = new Files()\n .withFeatureRoot(features)\n .withCallerFile(caller)\n .withStepsRoot(steps)\n .withAppRoot(app);\n return this.fs;\n }\n\n loadSteps() {\n const { steps } = this.config.roots;\n if (typeof steps === \"string\") {\n this.fs.fromUrlPattern(steps).loadStepDefinitions();\n return;\n }\n for (const stepRoot of steps) {\n this.fs.fromUrlPattern(stepRoot).loadStepDefinitions();\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,SAAwB,mBAAmB;AAI3C,SAAuB,aAA0B;AACjD,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAP9B;AAUO,IAAM,cAAN,MAAkB;AAAA,EAIvB,YACW,QACA,SACA,MACT;AAHS;AACA;AACA;AANX;AACA;AACA;AAME,kBAAc,SAAS,QAAQ;AAAA,EACjC;AAAA,EAEA,IACE,SACA,QACA,QACA,UAOA;AACA,kBAAc,UAAU,UAAU;AAElC,UAAM,KAAK,KAAK,WAAW,MAAM;AACjC,UAAM,OAAO,GAAG,eAAe,QAAQ,IAAI;AAC3C,SAAK,SAAS;AAEd,UAAM,UAAU,KAAK,eAAe;AACpC,QAAI,CAAC,MAAM,QAAQ,OAAO,GAAG;AAC3B,WAAK,MAAM,SAAS,SAAS,QAAQ,QAAQ;AAAA,IAC/C,OAAO;AACL,iBAAW,eAAe,SAAS;AACjC,aAAK,MAAM,aAAa,SAAS,QAAQ,QAAQ;AAAA,MACnD;AAAA,IACF;AAAA,EACF;AAAA,EAEQ,MACN,SACA,SACA,QACA,UAOA;AACA,SAAK,OAAO,OAAO;AACnB,SAAK,UAAU;AACf,SAAK,OAAO,KAAK;AACjB,uBAAK,UAAW,IAAI,YAAY,OAAO;AACvC,uBAAK,SAAU,mBAAK,UAAS,kBAAkB,OAAO;AACtD,UAAM,EAAE,KAAK,MAAM,IAAI,KAAK,KAAK,KAAK,OAAO,eAAe,SAAS;AACrE,aAAS,EAAE,KAAK,MAAM,GAAG,KAAK,QAAQ,mBAAK,UAAS,QAAQ,KAAK,OAAO;AAAA,EAC1E;AAAA,EAEA,IAAI,KAAK;AACP,QAAI,CAAC,mBAAK,MAAK;AACb,YAAM,IAAI,gBAAgB,6BAA6B;AAAA,IACzD;AACA,WAAO,mBAAK;AAAA,EACd;AAAA,EAEA,IAAI,SAAS;AACX,WAAO,KAAK,QAAQ;AAAA,EACtB;AAAA,EAEA,WAAW,QAAgB;AACzB,UAAM,EAAE,MAAM,IAAI,KAAK;AACvB,UAAM,EAAE,OAAO,UAAU,IAAI,IAAI;AAEjC,uBAAK,KAAM,IAAI,MAAM,EAClB,gBAAgB,QAAQ,EACxB,eAAe,MAAM,EACrB,cAAc,KAAK,EACnB,YAAY,GAAG;AAClB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,YAAY;AACV,UAAM,EAAE,MAAM,IAAI,KAAK,OAAO;AAC9B,QAAI,OAAO,UAAU,UAAU;AAC7B,WAAK,GAAG,eAAe,KAAK,EAAE,oBAAoB;AAClD;AAAA,IACF;AACA,eAAW,YAAY,OAAO;AAC5B,WAAK,GAAG,eAAe,QAAQ,EAAE,oBAAoB;AAAA,IACvD;AAAA,EACF;AACF;AA7FE;AACA;AACA;","names":[]}
package/dist/index.d.cts CHANGED
@@ -21,7 +21,7 @@ declare class Coordinator {
21
21
  run(feature: FeatureScope, caller: string, events: TestEventEmitter, executor: ({ app, world }: {
22
22
  app: Class<AutometaApp>;
23
23
  world: Class<AutometaWorld>;
24
- }, bridge: FeatureBridge, events: TestEventEmitter, config: Config) => void): void;
24
+ }, global: GlobalScope, bridge: FeatureBridge, events: TestEventEmitter, config: Config) => void): void;
25
25
  private start;
26
26
  get fs(): Files;
27
27
  get config(): {
package/dist/index.d.ts CHANGED
@@ -21,7 +21,7 @@ declare class Coordinator {
21
21
  run(feature: FeatureScope, caller: string, events: TestEventEmitter, executor: ({ app, world }: {
22
22
  app: Class<AutometaApp>;
23
23
  world: Class<AutometaWorld>;
24
- }, bridge: FeatureBridge, events: TestEventEmitter, config: Config) => void): void;
24
+ }, global: GlobalScope, bridge: FeatureBridge, events: TestEventEmitter, config: Config) => void): void;
25
25
  private start;
26
26
  get fs(): Files;
27
27
  get config(): {
package/dist/index.js CHANGED
@@ -79,7 +79,7 @@ var Coordinator = class {
79
79
  __privateSet(this, _builder, new import_test_builder.TestBuilder(gherkin));
80
80
  __privateSet(this, _bridge, __privateGet(this, _builder).onFeatureExecuted(feature));
81
81
  const { app, world } = this.opts[this.config.environment ?? "default"];
82
- executor({ app, world }, __privateGet(this, _bridge), events, this.configs);
82
+ executor({ app, world }, this.global, __privateGet(this, _bridge), events, this.configs);
83
83
  }
84
84
  get fs() {
85
85
  if (!__privateGet(this, _fs)) {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/coordinator.ts"],"sourcesContent":["export * from \"./coordinator\";\nexport * from \"./types\";\n","import { Config } from \"@autometa/config\";\nimport { FeatureBridge, TestBuilder } from \"@autometa/test-builder\";\nimport { AutometaApp, AutometaWorld } from \"@autometa/app\";\nimport { TestEventEmitter } from \"@autometa/events\";\nimport { Class } from \"@autometa/types\";\nimport { FeatureScope, Files, GlobalScope } from \"@autometa/scopes\";\nimport { AutomationError } from \"@autometa/errors\";\nimport { AssertDefined } from \"@autometa/asserters\";\nimport { CoordinatorOpts } from \"./types\";\nimport { Feature } from \"@autometa/gherkin\";\nexport class Coordinator {\n #fs: Files;\n #builder: TestBuilder;\n #bridge: FeatureBridge;\n constructor(\n readonly global: GlobalScope,\n readonly configs: Config,\n readonly opts: Record<string, CoordinatorOpts>\n ) {\n AssertDefined(configs, \"Config\");\n }\n\n run(\n feature: FeatureScope,\n caller: string,\n events: TestEventEmitter,\n executor: (\n { app, world }: { app: Class<AutometaApp>; world: Class<AutometaWorld> },\n bridge: FeatureBridge,\n events: TestEventEmitter,\n config: Config\n ) => void\n ) {\n AssertDefined(executor, \"Executor\");\n\n const fs = this.fileSystem(caller);\n const path = fs.fromUrlPattern(feature.path);\n path.loadApps();\n\n const gherkin = path.getFeatureFile();\n if (!Array.isArray(gherkin)) {\n this.start(gherkin, feature, events, executor);\n } else {\n for (const featGherkin of gherkin) {\n this.start(featGherkin, feature, events, executor);\n }\n }\n }\n\n private start(\n gherkin: Feature,\n feature: FeatureScope,\n events: TestEventEmitter,\n executor: (\n { app, world }: { app: Class<AutometaApp>; world: Class<AutometaWorld> },\n bridge: FeatureBridge,\n events: TestEventEmitter,\n config: Config\n ) => void\n ) {\n this.global.unlock();\n this.loadSteps();\n this.global.lock();\n this.#builder = new TestBuilder(gherkin);\n this.#bridge = this.#builder.onFeatureExecuted(feature);\n const { app, world } = this.opts[this.config.environment ?? \"default\"];\n executor({ app, world }, this.#bridge, events, this.configs);\n }\n\n get fs() {\n if (!this.#fs) {\n throw new AutomationError(\"File System not initialized\");\n }\n return this.#fs;\n }\n\n get config() {\n return this.configs.current;\n }\n\n fileSystem(caller: string) {\n const { roots } = this.config;\n const { steps, features, app } = roots;\n\n this.#fs = new Files()\n .withFeatureRoot(features)\n .withCallerFile(caller)\n .withStepsRoot(steps)\n .withAppRoot(app);\n return this.fs;\n }\n\n loadSteps() {\n const { steps } = this.config.roots;\n if (typeof steps === \"string\") {\n this.fs.fromUrlPattern(steps).loadStepDefinitions();\n return;\n }\n for (const stepRoot of steps) {\n this.fs.fromUrlPattern(stepRoot).loadStepDefinitions();\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,0BAA2C;AAI3C,oBAAiD;AACjD,oBAAgC;AAChC,uBAA8B;AAP9B;AAUO,IAAM,cAAN,MAAkB;AAAA,EAIvB,YACW,QACA,SACA,MACT;AAHS;AACA;AACA;AANX;AACA;AACA;AAME,wCAAc,SAAS,QAAQ;AAAA,EACjC;AAAA,EAEA,IACE,SACA,QACA,QACA,UAMA;AACA,wCAAc,UAAU,UAAU;AAElC,UAAM,KAAK,KAAK,WAAW,MAAM;AACjC,UAAM,OAAO,GAAG,eAAe,QAAQ,IAAI;AAC3C,SAAK,SAAS;AAEd,UAAM,UAAU,KAAK,eAAe;AACpC,QAAI,CAAC,MAAM,QAAQ,OAAO,GAAG;AAC3B,WAAK,MAAM,SAAS,SAAS,QAAQ,QAAQ;AAAA,IAC/C,OAAO;AACL,iBAAW,eAAe,SAAS;AACjC,aAAK,MAAM,aAAa,SAAS,QAAQ,QAAQ;AAAA,MACnD;AAAA,IACF;AAAA,EACF;AAAA,EAEQ,MACN,SACA,SACA,QACA,UAMA;AACA,SAAK,OAAO,OAAO;AACnB,SAAK,UAAU;AACf,SAAK,OAAO,KAAK;AACjB,uBAAK,UAAW,IAAI,gCAAY,OAAO;AACvC,uBAAK,SAAU,mBAAK,UAAS,kBAAkB,OAAO;AACtD,UAAM,EAAE,KAAK,MAAM,IAAI,KAAK,KAAK,KAAK,OAAO,eAAe,SAAS;AACrE,aAAS,EAAE,KAAK,MAAM,GAAG,mBAAK,UAAS,QAAQ,KAAK,OAAO;AAAA,EAC7D;AAAA,EAEA,IAAI,KAAK;AACP,QAAI,CAAC,mBAAK,MAAK;AACb,YAAM,IAAI,8BAAgB,6BAA6B;AAAA,IACzD;AACA,WAAO,mBAAK;AAAA,EACd;AAAA,EAEA,IAAI,SAAS;AACX,WAAO,KAAK,QAAQ;AAAA,EACtB;AAAA,EAEA,WAAW,QAAgB;AACzB,UAAM,EAAE,MAAM,IAAI,KAAK;AACvB,UAAM,EAAE,OAAO,UAAU,IAAI,IAAI;AAEjC,uBAAK,KAAM,IAAI,oBAAM,EAClB,gBAAgB,QAAQ,EACxB,eAAe,MAAM,EACrB,cAAc,KAAK,EACnB,YAAY,GAAG;AAClB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,YAAY;AACV,UAAM,EAAE,MAAM,IAAI,KAAK,OAAO;AAC9B,QAAI,OAAO,UAAU,UAAU;AAC7B,WAAK,GAAG,eAAe,KAAK,EAAE,oBAAoB;AAClD;AAAA,IACF;AACA,eAAW,YAAY,OAAO;AAC5B,WAAK,GAAG,eAAe,QAAQ,EAAE,oBAAoB;AAAA,IACvD;AAAA,EACF;AACF;AA3FE;AACA;AACA;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/coordinator.ts"],"sourcesContent":["export * from \"./coordinator\";\nexport * from \"./types\";\n","import { Config } from \"@autometa/config\";\nimport { FeatureBridge, TestBuilder } from \"@autometa/test-builder\";\nimport { AutometaApp, AutometaWorld } from \"@autometa/app\";\nimport { TestEventEmitter } from \"@autometa/events\";\nimport { Class } from \"@autometa/types\";\nimport { FeatureScope, Files, GlobalScope } from \"@autometa/scopes\";\nimport { AutomationError } from \"@autometa/errors\";\nimport { AssertDefined } from \"@autometa/asserters\";\nimport { CoordinatorOpts } from \"./types\";\nimport { Feature } from \"@autometa/gherkin\";\nexport class Coordinator {\n #fs: Files;\n #builder: TestBuilder;\n #bridge: FeatureBridge;\n constructor(\n readonly global: GlobalScope,\n readonly configs: Config,\n readonly opts: Record<string, CoordinatorOpts>\n ) {\n AssertDefined(configs, \"Config\");\n }\n\n run(\n feature: FeatureScope,\n caller: string,\n events: TestEventEmitter,\n executor: (\n { app, world }: { app: Class<AutometaApp>; world: Class<AutometaWorld> },\n global: GlobalScope,\n bridge: FeatureBridge,\n events: TestEventEmitter,\n config: Config\n ) => void\n ) {\n AssertDefined(executor, \"Executor\");\n\n const fs = this.fileSystem(caller);\n const path = fs.fromUrlPattern(feature.path);\n path.loadApps();\n\n const gherkin = path.getFeatureFile();\n if (!Array.isArray(gherkin)) {\n this.start(gherkin, feature, events, executor);\n } else {\n for (const featGherkin of gherkin) {\n this.start(featGherkin, feature, events, executor);\n }\n }\n }\n\n private start(\n gherkin: Feature,\n feature: FeatureScope,\n events: TestEventEmitter,\n executor: (\n { app, world }: { app: Class<AutometaApp>; world: Class<AutometaWorld> },\n global: GlobalScope,\n bridge: FeatureBridge,\n events: TestEventEmitter,\n config: Config\n ) => void\n ) {\n this.global.unlock();\n this.loadSteps();\n this.global.lock();\n this.#builder = new TestBuilder(gherkin);\n this.#bridge = this.#builder.onFeatureExecuted(feature);\n const { app, world } = this.opts[this.config.environment ?? \"default\"];\n executor({ app, world }, this.global, this.#bridge, events, this.configs);\n }\n\n get fs() {\n if (!this.#fs) {\n throw new AutomationError(\"File System not initialized\");\n }\n return this.#fs;\n }\n\n get config() {\n return this.configs.current;\n }\n\n fileSystem(caller: string) {\n const { roots } = this.config;\n const { steps, features, app } = roots;\n\n this.#fs = new Files()\n .withFeatureRoot(features)\n .withCallerFile(caller)\n .withStepsRoot(steps)\n .withAppRoot(app);\n return this.fs;\n }\n\n loadSteps() {\n const { steps } = this.config.roots;\n if (typeof steps === \"string\") {\n this.fs.fromUrlPattern(steps).loadStepDefinitions();\n return;\n }\n for (const stepRoot of steps) {\n this.fs.fromUrlPattern(stepRoot).loadStepDefinitions();\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,0BAA2C;AAI3C,oBAAiD;AACjD,oBAAgC;AAChC,uBAA8B;AAP9B;AAUO,IAAM,cAAN,MAAkB;AAAA,EAIvB,YACW,QACA,SACA,MACT;AAHS;AACA;AACA;AANX;AACA;AACA;AAME,wCAAc,SAAS,QAAQ;AAAA,EACjC;AAAA,EAEA,IACE,SACA,QACA,QACA,UAOA;AACA,wCAAc,UAAU,UAAU;AAElC,UAAM,KAAK,KAAK,WAAW,MAAM;AACjC,UAAM,OAAO,GAAG,eAAe,QAAQ,IAAI;AAC3C,SAAK,SAAS;AAEd,UAAM,UAAU,KAAK,eAAe;AACpC,QAAI,CAAC,MAAM,QAAQ,OAAO,GAAG;AAC3B,WAAK,MAAM,SAAS,SAAS,QAAQ,QAAQ;AAAA,IAC/C,OAAO;AACL,iBAAW,eAAe,SAAS;AACjC,aAAK,MAAM,aAAa,SAAS,QAAQ,QAAQ;AAAA,MACnD;AAAA,IACF;AAAA,EACF;AAAA,EAEQ,MACN,SACA,SACA,QACA,UAOA;AACA,SAAK,OAAO,OAAO;AACnB,SAAK,UAAU;AACf,SAAK,OAAO,KAAK;AACjB,uBAAK,UAAW,IAAI,gCAAY,OAAO;AACvC,uBAAK,SAAU,mBAAK,UAAS,kBAAkB,OAAO;AACtD,UAAM,EAAE,KAAK,MAAM,IAAI,KAAK,KAAK,KAAK,OAAO,eAAe,SAAS;AACrE,aAAS,EAAE,KAAK,MAAM,GAAG,KAAK,QAAQ,mBAAK,UAAS,QAAQ,KAAK,OAAO;AAAA,EAC1E;AAAA,EAEA,IAAI,KAAK;AACP,QAAI,CAAC,mBAAK,MAAK;AACb,YAAM,IAAI,8BAAgB,6BAA6B;AAAA,IACzD;AACA,WAAO,mBAAK;AAAA,EACd;AAAA,EAEA,IAAI,SAAS;AACX,WAAO,KAAK,QAAQ;AAAA,EACtB;AAAA,EAEA,WAAW,QAAgB;AACzB,UAAM,EAAE,MAAM,IAAI,KAAK;AACvB,UAAM,EAAE,OAAO,UAAU,IAAI,IAAI;AAEjC,uBAAK,KAAM,IAAI,oBAAM,EAClB,gBAAgB,QAAQ,EACxB,eAAe,MAAM,EACrB,cAAc,KAAK,EACnB,YAAY,GAAG;AAClB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,YAAY;AACV,UAAM,EAAE,MAAM,IAAI,KAAK,OAAO;AAC9B,QAAI,OAAO,UAAU,UAAU;AAC7B,WAAK,GAAG,eAAe,KAAK,EAAE,oBAAoB;AAClD;AAAA,IACF;AACA,eAAW,YAAY,OAAO;AAC5B,WAAK,GAAG,eAAe,QAAQ,EAAE,oBAAoB;AAAA,IACvD;AAAA,EACF;AACF;AA7FE;AACA;AACA;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autometa/coordinator",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -26,21 +26,21 @@
26
26
  "tsup": "^7.2.0",
27
27
  "typescript": "^4.9.5",
28
28
  "vitest": "^0.29.8",
29
- "tsconfig": "0.7.0",
30
- "eslint-config-custom": "0.6.0"
29
+ "eslint-config-custom": "0.6.0",
30
+ "tsconfig": "0.7.0"
31
31
  },
32
32
  "dependencies": {
33
33
  "tsyringe": "^4.8.0",
34
+ "@autometa/app": "^0.1.3",
34
35
  "@autometa/asserters": "^0.1.1",
35
36
  "@autometa/config": "^0.1.3",
36
37
  "@autometa/errors": "^0.1.1",
37
- "@autometa/events": "^0.1.1",
38
- "@autometa/scopes": "^0.2.3",
39
- "@autometa/jest-executor": "^0.1.3",
40
- "@autometa/gherkin": "^0.4.1",
41
- "@autometa/test-builder": "^0.1.3",
38
+ "@autometa/events": "^0.1.2",
39
+ "@autometa/gherkin": "^0.4.2",
40
+ "@autometa/scopes": "^0.2.4",
41
+ "@autometa/jest-executor": "^0.1.4",
42
42
  "@autometa/types": "^0.4.0",
43
- "@autometa/app": "^0.1.3"
43
+ "@autometa/test-builder": "^0.1.4"
44
44
  },
45
45
  "scripts": {
46
46
  "test": "vitest run --passWithNoTests",