New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@travetto/test

Package Overview
Dependencies
Maintainers
1
Versions
358
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@travetto/test - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

2

package.json

@@ -28,3 +28,3 @@ {

},
"version": "0.0.4"
"version": "0.0.5"
}

@@ -22,3 +22,10 @@ import { AppEnv } from '@travetto/base';

let base = process.cwd() + '/test/';
let lines = err.stack!.split('[Continued From]').find(x => x.includes(base)).split('\n').filter(x => x.includes(base));
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(':');

@@ -25,0 +32,0 @@ file = file.split(process.cwd() + '/')[1];

@@ -114,2 +114,25 @@ import * as fs from 'fs';

static async affixProcess(suite: SuiteConfig, result: SuiteResult, phase: 'beforeAll' | 'afterAll' | 'beforeEach' | 'afterEach') {
try {
for (let after of suite[phase]) {
await after.call(suite.instance);
}
} catch (error) {
let { line, file } = AssertUtil.readFilePosition(error);
result.tests.push({
status: 'fail',
suiteName: suite.name,
method: phase,
description: phase,
line,
lineEnd: line,
file,
error,
assertions: [],
output: {}
} as TestResult);
throw new Error('breakout');
}
}
static async executeSuite(suite: SuiteConfig, emitter?: TestEmitter) {

@@ -129,32 +152,32 @@ let result: SuiteResult = {

for (let before of suite.beforeAll) {
await before.call(suite.instance);
}
try {
await this.affixProcess(suite, result, 'beforeAll');
for (let test of suite.tests) {
if (emitter) {
emitter.emit({ type: 'test', phase: 'before', test });
}
for (let test of suite.tests) {
if (emitter) {
emitter.emit({ type: 'test', phase: 'before', test });
}
for (let before of suite.beforeEach) {
await before.call(suite.instance);
}
await this.affixProcess(suite, result, 'beforeEach');
let ret = await this.executeTest(test);
result[ret.status]++;
result.tests.push(ret);
let ret = await this.executeTest(test);
result[ret.status]++;
result.tests.push(ret);
if (emitter) {
emitter.emit({ type: 'test', phase: 'after', test: ret });
if (emitter) {
emitter.emit({ type: 'test', phase: 'after', test: ret });
}
await this.affixProcess(suite, result, 'afterEach');
}
for (let after of suite.afterEach) {
await after.call(suite.instance);
await this.affixProcess(suite, result, 'afterAll');
} catch (e) {
if (e.message === 'breakout') {
// Done
} else {
throw e;
}
}
for (let after of suite.afterAll) {
await after.call(suite.instance);
}
result.total = result.success + result.fail;

@@ -161,0 +184,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc