@travetto/test
Advanced tools
Comparing version 0.0.36 to 0.0.37
@@ -31,3 +31,3 @@ { | ||
}, | ||
"version": "0.0.36" | ||
"version": "0.0.37" | ||
} |
@@ -52,3 +52,3 @@ import { AppEnv } from '@travetto/base'; | ||
static asserts: Assertion[] = []; | ||
static assertions: Assertion[] = []; | ||
static listener?: (a: Assertion) => void; | ||
@@ -83,3 +83,3 @@ static test: TestConfig; | ||
this.listener = listener; | ||
this.asserts = []; | ||
this.assertions = []; | ||
} | ||
@@ -166,3 +166,3 @@ | ||
static add(a: Assertion) { | ||
this.asserts.push(a); | ||
this.assertions.push(a); | ||
if (this.listener) { | ||
@@ -174,4 +174,4 @@ this.listener(a); | ||
static end() { | ||
const ret = this.asserts; | ||
this.asserts = []; | ||
const ret = this.assertions; | ||
this.assertions = []; | ||
delete this.listener, this.test; | ||
@@ -178,0 +178,0 @@ return ret; |
import * as fs from 'fs'; | ||
import * as readline from 'readline'; | ||
import * as assert from 'assert'; | ||
import { bulkFind } from '@travetto/base'; | ||
import { bulkFind, BaseError } from '@travetto/base'; | ||
@@ -167,3 +167,3 @@ import { TestConfig, TestResult, SuiteConfig, SuiteResult, Assertion } from '../model'; | ||
if (err === TIMEOUT) { | ||
err = new Error('Operation timed out'); | ||
err = new BaseError('Operation timed out'); | ||
} else { | ||
@@ -177,2 +177,16 @@ err = this.checkError(test, err); | ||
result.error = err; | ||
if (!(err instanceof assert.AssertionError)) { | ||
const assrt = { | ||
className: test.className, | ||
error: err, | ||
methodName: test.methodName, | ||
operator: 'throws', | ||
message: err.message, | ||
file: test.file, | ||
text: '(unknown)', | ||
line: AssertUtil.readFilePosition(err, test.file).line | ||
} | ||
AssertUtil.add(assrt); | ||
} | ||
} | ||
@@ -179,0 +193,0 @@ } finally { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47104
1351