@brillout/test-e2e 0.4.3 → 0.4.5

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 (2) hide show
  1. package/dist/setup.js +28 -7
  2. package/package.json +1 -1
package/dist/setup.js CHANGED
@@ -308,23 +308,24 @@ function execRunScript({ onStdout, onFailure, onExit, }) {
308
308
  await terminate(true);
309
309
  onFailure(err);
310
310
  };
311
- proc.stdin.on('data', async (data) => {
311
+ proc.stdin.on('data', async (chunk) => {
312
+ const data = String(chunk);
312
313
  await exitAndFail(new Error(`Command is \`${cmd}\` (${cwd}) is invoking \`stdin\`: ${data}.`));
313
314
  });
314
- proc.stdout.on('data', (data) => {
315
- (0, utils_2.assert)(!procExited);
315
+ proc.stdout.on('data', (chunk) => {
316
+ const data = String(chunk);
317
+ assertNotExited(data);
316
318
  (0, utils_2.assert)(getRunInfo().cmd === cmd);
317
- data = data.toString();
318
319
  Logs_1.Logs.add({
319
320
  logSource: 'stdout',
320
321
  logText: data,
321
322
  });
322
323
  onStdout?.(data);
323
324
  });
324
- proc.stderr.on('data', async (data) => {
325
- (0, utils_2.assert)(!procExited);
325
+ proc.stderr.on('data', async (chunk) => {
326
+ const data = String(chunk);
327
+ assertNotExited(data);
326
328
  (0, utils_2.assert)(getRunInfo().cmd === cmd);
327
- data = data.toString();
328
329
  Logs_1.Logs.add({
329
330
  logSource: 'stderr',
330
331
  logText: data,
@@ -358,6 +359,14 @@ function execRunScript({ onStdout, onFailure, onExit, }) {
358
359
  exitPromiseResolve();
359
360
  });
360
361
  return { terminate, processHasExited };
362
+ function assertNotExited(data) {
363
+ if (!procExited)
364
+ return;
365
+ Logs_1.Logs.logErrors(true);
366
+ Logs_1.Logs.flushLogs();
367
+ logDebugInfo(data);
368
+ (0, utils_2.assert)(false);
369
+ }
361
370
  function processHasExited() {
362
371
  return procExited;
363
372
  }
@@ -484,3 +493,15 @@ function getPort() {
484
493
  (0, utils_2.assert)(/\d+/.test(port), { serverUrl });
485
494
  return port;
486
495
  }
496
+ function logDebugInfo(data) {
497
+ console.log('vvvvv DEBUG INFO vvvvv');
498
+ const testInfo = (0, getCurrentTest_1.getCurrentTest)();
499
+ console.log('testInfo.hasStartedRunning', testInfo.hasStartedRunning);
500
+ console.log('testInfo.skipped', testInfo.skipped);
501
+ console.log('testInfo.runInfo', testInfo.runInfo);
502
+ console.log('testInfo.testFile', testInfo.testFile);
503
+ console.log('testInfo.testName', testInfo.testName);
504
+ console.log('data', data);
505
+ console.log('process.platform', process.platform);
506
+ console.log('^^^^^ DEBUG INFO ^^^^^');
507
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brillout/test-e2e",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "bin": "./bin.js",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {