@travetto/test
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -7,3 +7,3 @@ { | ||
"bin": { | ||
"travetto-test": "bin/encore-test.js" | ||
"travetto-test": "bin/travetto-test.js" | ||
}, | ||
@@ -29,3 +29,3 @@ "dependencies": { | ||
}, | ||
"version": "0.0.7" | ||
"version": "0.0.8" | ||
} |
@@ -22,13 +22,11 @@ import { AppEnv } from '@travetto/base'; | ||
let base = process.cwd() + '/test/'; | ||
let subParts = err.stack!.split('[Continued From]'); | ||
let sub: string = subParts.find(x => x.includes(base))!; | ||
let lines: string[]; | ||
if (!sub) { | ||
lines = subParts[0].split('\n').slice(1, 2); | ||
} else { | ||
lines = sub.split('\n').filter(x => x.includes(base)); | ||
} | ||
let [file, line] = lines.pop()!.split(/[()]/g).slice(-2, -1)[0].split(':'); | ||
let sub: string = err.stack!; | ||
let lines = sub.split('\n').filter(x => x.includes(base)); | ||
let [fn, path] = lines[0].trim().split(/\s+/g).slice(1); | ||
let [file, lineNo, col] = path.replace(/[()]/g, '').split(':') | ||
file = file.split(process.cwd() + '/')[1]; | ||
return { file, line: parseInt(line, 10) }; | ||
return { file, line: parseInt(lineNo, 10) }; | ||
} | ||
@@ -35,0 +33,0 @@ |
@@ -17,3 +17,3 @@ import * as minimist from 'minimist'; | ||
default: { | ||
tap: false, | ||
tap: true, | ||
format: 'noop' | ||
@@ -20,0 +20,0 @@ }, |
@@ -187,3 +187,12 @@ import * as fs from 'fs'; | ||
static async executeFile(file: string, emitter?: TestEmitter) { | ||
require(`${process.cwd()}/${file}`); | ||
try { | ||
require(`${process.cwd()}/${file}`); | ||
} catch (e) { | ||
if (emitter) { | ||
emitter.emit({ | ||
phase: 'before', type: 'suite', suite: {} as SuiteConfig | ||
}); | ||
} | ||
return; | ||
} | ||
@@ -190,0 +199,0 @@ await TestRegistry.init(); |
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
255592
1080