Socket
Socket
Sign inDemoInstall

@web/test-runner-core

Package Overview
Dependencies
Maintainers
6
Versions
144
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@web/test-runner-core - npm Package Compare versions

Comparing version 0.5.1 to 0.5.2

6

CHANGELOG.md
# @web/test-runner-core
## 0.5.2
### Patch Changes
- f5eff91: clear timeouts on close
## 0.5.1

@@ -4,0 +10,0 @@

1

dist/runner/TestRunner.js

@@ -98,2 +98,3 @@ "use strict";

this.stopped = true;
this.scheduler.stop();
this.config.server.stop().catch(error => {

@@ -100,0 +101,0 @@ console.error(error);

@@ -7,3 +7,7 @@ import { TestRunnerConfig } from './TestRunnerConfig';

private sessions;
private timeoutIdsPerSession;
constructor(config: TestRunnerConfig, sessions: TestSessionManager);
stop(): void;
private addTimeoutId;
private clearTimeouts;
schedule(testRun: number, sessionsToSchedule: Iterable<TestSession>): Promise<void[]>;

@@ -10,0 +14,0 @@ runScheduled(testRun: number): Promise<void[]>;

@@ -10,3 +10,28 @@ "use strict";

this.sessions = sessions;
this.timeoutIdsPerSession = new Map();
sessions.on('session-status-updated', session => {
const timeoutIds = this.timeoutIdsPerSession.get(session.id);
if (timeoutIds && session.status === TestSessionStatus_1.SESSION_STATUS.FINISHED) {
this.clearTimeouts(timeoutIds);
}
});
}
stop() {
for (const ids of this.timeoutIdsPerSession.values()) {
this.clearTimeouts(ids);
}
}
addTimeoutId(sessionId, id) {
let timeoutIds = this.timeoutIdsPerSession.get(sessionId);
if (!timeoutIds) {
timeoutIds = [];
this.timeoutIdsPerSession.set(sessionId, timeoutIds);
}
timeoutIds.push(id);
}
clearTimeouts(timeoutIds) {
for (const id of timeoutIds) {
clearTimeout(id);
}
}
async schedule(testRun, sessionsToSchedule) {

@@ -36,3 +61,3 @@ for (const session of sessionsToSchedule) {

// browser should be started within the specified milliseconds
setTimeout(() => {
const timeoutId = setTimeout(() => {
if (!browserStartResponded) {

@@ -44,2 +69,3 @@ this.setSessionFailed(this.sessions.get(session.id), {

}, this.config.browserStartTimeout);
this.addTimeoutId(session.id, timeoutId);
try {

@@ -62,3 +88,3 @@ // TODO: Select associated browser

setSessionStartedTimeout(testRun, sessionId) {
setTimeout(() => {
const timeoutId = setTimeout(() => {
const session = this.sessions.get(sessionId);

@@ -81,5 +107,6 @@ if (session.testRun !== testRun) {

}, this.config.sessionStartTimeout);
this.addTimeoutId(sessionId, timeoutId);
}
setSessionFinishedTimeout(testRun, sessionId) {
setTimeout(() => {
const timeoutId = setTimeout(() => {
const session = this.sessions.get(sessionId);

@@ -96,2 +123,3 @@ if (session.testRun !== testRun) {

}, this.config.sessionFinishTimeout);
this.addTimeoutId(sessionId, timeoutId);
}

@@ -98,0 +126,0 @@ }

2

package.json
{
"name": "@web/test-runner-core",
"version": "0.5.1",
"version": "0.5.2",
"publishConfig": {

@@ -5,0 +5,0 @@ "access": "public"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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