@nsshunt/stsrunnerframework 1.0.130 → 1.0.131

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/README.md CHANGED
@@ -71,16 +71,6 @@ parentPort?.on('message', (data: any) => {
71
71
  } else {
72
72
  throw new Error(`Invalid command: [${command}]`)
73
73
  }
74
- } else {
75
- const { command, payload } = data.data;
76
- if (command === eIWMessageCommands.MessagePort) {
77
- payload.port.on('message', (data: any) => {
78
- worker.ProcessMessage(data.data); // browser version
79
- });
80
- worker.ProcessMessage(data.data);
81
- } else {
82
- throw new Error(`Invalid command: [${command}]`)
83
- }
84
74
  }
85
75
  });
86
76
  ```
@@ -91,8 +81,6 @@ parentPort?.on('message', (data: any) => {
91
81
  import { IRunnerInstance, ITestRunnerTelemetryPayload, WorkerInstance, eIWMessageCommands } from './../index'
92
82
  import { TestCase01 } from './testCase01'
93
83
 
94
- import isNode from 'detect-node'
95
-
96
84
  export class WorkerTestCases extends WorkerInstance {
97
85
  constructor() {
98
86
  super()
@@ -111,26 +99,23 @@ export class WorkerTestCases extends WorkerInstance {
111
99
  const worker = new WorkerTestCases();
112
100
 
113
101
  onmessage = async function(data: any) {
114
- if (isNode) {
115
- const { command, payload } = data;
116
- if (command === eIWMessageCommands.MessagePort) {
117
- payload.port.on('message', (data: any) => {
118
- worker.ProcessMessage(data);
119
- });
120
- worker.ProcessMessage(data);
121
- } else {
122
- throw new Error(`Invalid command: [${command}]`)
123
- }
102
+ const { command, payload } = data.data;
103
+ if (command === eIWMessageCommands.MessagePort) {
104
+ payload.port.start();
105
+ payload.port.addEventListener('message', (data: any) => {
106
+ worker.ProcessMessage(data.data); // browser version
107
+ });
108
+
109
+ /*
110
+ payload.port.addEventListener('messageerror', (error: any) => {
111
+ console.error(`onmessageerror(): [${error}]`)
112
+ worker.ProcessMessage(data.data); // browser version
113
+ });
114
+ */
115
+
116
+ worker.ProcessMessage(data.data);
124
117
  } else {
125
- const { command, payload } = data.data;
126
- if (command === eIWMessageCommands.MessagePort) {
127
- payload.port.on('message', (data: any) => {
128
- worker.ProcessMessage(data.data); // browser version
129
- });
130
- worker.ProcessMessage(data.data);
131
- } else {
132
- throw new Error(`Invalid command: [${command}]`)
133
- }
118
+ throw new Error(`Invalid command: [${command}]`)
134
119
  }
135
120
  }
136
121
  ```
@@ -2383,7 +2383,16 @@ class STSWorkerManager {
2383
2383
  // Filter by plan and/or tag. Leave blank to not use in filter.
2384
2384
  __publicField(this, "GetArchiveList", (runnerSearchFilters) => {
2385
2385
  try {
2386
- return __privateGet(this, _archiveList).filter((runner) => !runnerSearchFilters.plan ? true : !runner.options.plan ? false : runner.options.plan.localeCompare(runnerSearchFilters.plan) === 0).filter((runner) => !runnerSearchFilters.planId ? true : !runner.options.planId ? false : runner.options.planId.localeCompare(runnerSearchFilters.planId) === 0).filter((runner) => !runnerSearchFilters.tag ? true : !runner.options.tag ? false : runner.options.tag.includes(runnerSearchFilters.tag)).filter((runner) => !runnerSearchFilters.userDataKey ? true : !runner.options.userData ? false : runner.options.userData[runnerSearchFilters.userDataKey] ? true : false);
2386
+ return __privateGet(this, _archiveList).filter((runner) => {
2387
+ var _a, _b;
2388
+ return !runnerSearchFilters.plan ? true : ((_b = (_a = runner.options.runnerPlan) == null ? void 0 : _a.plan) == null ? void 0 : _b.localeCompare(runnerSearchFilters.plan)) === 0;
2389
+ }).filter((runner) => {
2390
+ var _a, _b;
2391
+ return !runnerSearchFilters.planId ? true : ((_b = (_a = runner.options.runnerPlan) == null ? void 0 : _a.planId) == null ? void 0 : _b.localeCompare(runnerSearchFilters.planId)) === 0;
2392
+ }).filter((runner) => {
2393
+ var _a;
2394
+ return !runnerSearchFilters.tag ? true : (_a = runner.options.tag) == null ? void 0 : _a.includes(runnerSearchFilters.tag);
2395
+ }).filter((runner) => !runnerSearchFilters.userDataKey ? true : !runner.options.userData ? false : !!runner.options.userData[runnerSearchFilters.userDataKey]);
2387
2396
  } catch (error) {
2388
2397
  __privateGet(this, _error2).call(this, `GetArchiveList(): Error: [${error}]`);
2389
2398
  return [];
@@ -3211,11 +3220,15 @@ class STSWorkerManager {
3211
3220
  const retVal = {
3212
3221
  id: runnerEx.id,
3213
3222
  iteration: runnerEx.iteration,
3214
- state: runnerEx.state,
3215
- options: {
3216
- plan: runnerEx.options.plan
3217
- }
3223
+ state: runnerEx.state
3218
3224
  };
3225
+ if (runnerEx.options && runnerEx.options.runnerPlan) {
3226
+ retVal.options = {
3227
+ runnerPlan: {
3228
+ plan: runnerEx.options.runnerPlan.plan
3229
+ }
3230
+ };
3231
+ }
3219
3232
  return retVal;
3220
3233
  } catch (error) {
3221
3234
  __privateGet(this, _error2).call(this, `CreateRunnerCopy(): Error: [${error}]`);