@locustjs/test 1.1.6 → 1.1.7

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/index.cjs.js CHANGED
@@ -568,7 +568,7 @@ class TestRunner {
568
568
  }
569
569
  return _test;
570
570
  }).filter(test => test instanceof Test).map((test, i) => this._runSingle(test, onProgress, i));
571
- Promise.all(_tests).then(_ => res()).catch(ex => {
571
+ Promise.all(_tests).then(_ => res(this.result)).catch(ex => {
572
572
  this._errors.push({
573
573
  err: new Exception({
574
574
  message: `not all tests succeeded. check errors.`,
@@ -577,7 +577,7 @@ class TestRunner {
577
577
  innerException: ex
578
578
  })
579
579
  });
580
- res();
580
+ res(this.result);
581
581
  });
582
582
  } else {
583
583
  this._errors.push({
@@ -587,7 +587,7 @@ class TestRunner {
587
587
  status: 'invalid-tests'
588
588
  })
589
589
  });
590
- res();
590
+ res(this.result);
591
591
  }
592
592
  } else {
593
593
  this._errors.push({
@@ -597,7 +597,7 @@ class TestRunner {
597
597
  status: 'no-tests'
598
598
  })
599
599
  });
600
- res();
600
+ res(this.result);
601
601
  }
602
602
  });
603
603
  }
@@ -632,7 +632,7 @@ class TestRunner {
632
632
  }
633
633
  }
634
634
  }
635
- const text = (detailed ? '\n' : '') + `Tests: ${this._passed + this._failed}` + '\n' + `Time: ${time / 1000} sec` + '\n\n' + (this._passed > 0 ? `\x1b[${ConsoleColors.ForeColor.Green}m ${this._passed} tests passed ${ConsoleColors.Modifier.Reset}` : '0 tests passed') + ', ' + (this._failed > 0 ? `\x1b[${ConsoleColors.ForeColor.Red}m ${this._failed} tests failed ${ConsoleColors.Modifier.Reset}` : '0 tests failed') + '\n';
635
+ const text = (detailed ? '\n' : '') + `Tests: ${this._passed + this._failed}` + '\n' + `Time: ${time / 1000} sec` + '\n\n' + (this._passed > 0 ? `\x1b[${ConsoleColors.ForeColor.Green}m ${this._passed} tests passed${ConsoleColors.Modifier.Reset}` : '0 tests passed') + ', ' + (this._failed > 0 ? `\x1b[${ConsoleColors.ForeColor.Red}m ${this._failed} tests failed${ConsoleColors.Modifier.Reset}` : '0 tests failed') + '\n';
636
636
  console.log(text);
637
637
  }
638
638
  log(filename) {
package/index.esm.js CHANGED
@@ -384,20 +384,20 @@ class TestRunner {
384
384
  .filter(test => (test instanceof Test))
385
385
  .map((test, i) => this._runSingle(test, onProgress, i));
386
386
 
387
- Promise.all(_tests).then(_ => res()).catch(ex => {
387
+ Promise.all(_tests).then(_ => res(this.result)).catch(ex => {
388
388
  this._errors.push({ err: new Exception({ message: `not all tests succeeded. check errors.`, code: 1503, status: 'partial-finished', innerException: ex }) });
389
389
 
390
- res();
390
+ res(this.result);
391
391
  });
392
392
  } else {
393
393
  this._errors.push({ err: new Exception({ message: `invalid tests. expected array or a single test.`, code: 1502, status: 'invalid-tests' }) });
394
394
 
395
- res();
395
+ res(this.result);
396
396
  }
397
397
  } else {
398
398
  this._errors.push({ err: new Exception({ message: `no tests given to be ran.`, code: 1501, status: 'no-tests' }) });
399
399
 
400
- res();
400
+ res(this.result);
401
401
  }
402
402
  })
403
403
  }
@@ -446,9 +446,9 @@ class TestRunner {
446
446
  '\n' +
447
447
  `Time: ${time / 1000} sec` +
448
448
  '\n\n' +
449
- (this._passed > 0 ? `\x1b[${ConsoleColors.ForeColor.Green}m ${this._passed} tests passed ${ConsoleColors.Modifier.Reset}` : '0 tests passed') +
449
+ (this._passed > 0 ? `\x1b[${ConsoleColors.ForeColor.Green}m ${this._passed} tests passed${ConsoleColors.Modifier.Reset}` : '0 tests passed') +
450
450
  ', ' +
451
- (this._failed > 0 ? `\x1b[${ConsoleColors.ForeColor.Red}m ${this._failed} tests failed ${ConsoleColors.Modifier.Reset}` : '0 tests failed') +
451
+ (this._failed > 0 ? `\x1b[${ConsoleColors.ForeColor.Red}m ${this._failed} tests failed${ConsoleColors.Modifier.Reset}` : '0 tests failed') +
452
452
  '\n';
453
453
 
454
454
  console.log(text);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@locustjs/test",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "This library provides a simple test runner.",
5
5
  "main": "index.cjs.js",
6
6
  "module": "index.esm.js",