testit-adapter-codecept 5.1.0 → 5.1.1

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.
@@ -7,17 +7,21 @@ module.exports = async function () {
7
7
  const config = new testit_js_commons_1.ConfigComposer().compose();
8
8
  const strategy = testit_js_commons_1.StrategyFactory.create(config);
9
9
  const helper = codeceptjs_1.container.helpers("TestITHelper");
10
- await strategy.setup();
10
+ // Register listeners before setup: early tests finish during TMS/sync-storage init
11
+ // and would otherwise be lost (flaky 30/33). Handlers await this promise first.
12
+ const setupPromise = strategy.setup();
11
13
  let finalized = false;
12
14
  const finalize = async () => {
13
15
  if (finalized) {
14
16
  return;
15
17
  }
16
18
  finalized = true;
19
+ await setupPromise;
17
20
  await strategy.teardown();
18
21
  };
19
22
  codeceptjs_1.event.dispatcher.on(codeceptjs_1.event.test.finished, (test) => {
20
23
  codeceptjs_1.recorder.add("transferTestAndRuns", async () => {
24
+ await setupPromise;
21
25
  // Keep sync-storage LastStatus fresh; otherwise Force Work X fires after ~60s of in_progress.
22
26
  await strategy.touchWorker();
23
27
  const autotest = builders_1.TestsBuilder.build(test);
@@ -43,4 +47,5 @@ module.exports = async function () {
43
47
  codeceptjs_1.event.dispatcher.on(codeceptjs_1.event.workers.after, async () => {
44
48
  await finalize();
45
49
  });
50
+ await setupPromise;
46
51
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testit-adapter-codecept",
3
- "version": "5.1.0",
3
+ "version": "5.1.1",
4
4
  "description": "Codecept adapter for Test IT",
5
5
  "keywords": [],
6
6
  "author": {
@@ -15,7 +15,7 @@
15
15
  "watch": "tsc -p tsconfig.json -w"
16
16
  },
17
17
  "dependencies": {
18
- "testit-js-commons": "5.1.0"
18
+ "testit-js-commons": "5.1.1"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@codeceptjs/configure": "^0.10.0",