🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@web/test-runner-core

Package Overview
Dependencies
Maintainers
6
Versions
145
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

to
0.6.2

6

CHANGELOG.md
# @web/test-runner-core
## 0.6.2
### Patch Changes
- 3dab600: profile test coverage through v8/chromium
## 0.6.1

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

8

dist/browser-launcher/BrowserLauncher.d.ts

@@ -0,1 +1,2 @@

import { CoverageMapData } from 'istanbul-lib-coverage';
import { TestRunnerCoreConfig } from '../runner/TestRunnerCoreConfig';

@@ -9,3 +10,3 @@ import { TestSession } from '../test-session/TestSession';

*/
start(config: TestRunnerCoreConfig): Promise<string[]>;
start(config: TestRunnerCoreConfig, testFiles: string[]): Promise<string[]>;
/**

@@ -33,2 +34,7 @@ * One time teardown for the browser launcher. Called when the test runner

/**
* Gets the test coverage for the test session if the browser launcher implementation
* supports it.
*/
getTestCoverage?(session: TestSession): undefined | Promise<CoverageMapData | undefined>;
/**
* Starts a debug session. This should start a session like startSession, but

@@ -35,0 +41,0 @@ * without headless. If the implementation does not support debugging,

4

dist/coverage/getTestCoverage.d.ts
import { CoverageSummaryData, CoverageMap } from 'istanbul-lib-coverage';
import { TestSession } from '../test-session/TestSession';
import { CoverageThresholdConfig } from '../runner/TestRunnerCoreConfig';
import { CoverageConfig } from '../runner/TestRunnerCoreConfig';
export declare const coverageTypes: (keyof CoverageSummaryData)[];

@@ -10,3 +10,3 @@ export interface TestCoverage {

}
export declare function getTestCoverage(sessions: Iterable<TestSession>, coverageThreshold?: CoverageThresholdConfig): TestCoverage;
export declare function getTestCoverage(sessions: Iterable<TestSession>, config?: CoverageConfig): TestCoverage;
//# sourceMappingURL=getTestCoverage.d.ts.map

@@ -11,3 +11,3 @@ "use strict";

];
function getTestCoverage(sessions, coverageThreshold) {
function getTestCoverage(sessions, config) {
const coverageMap = istanbul_lib_coverage_1.createCoverageMap();

@@ -20,6 +20,6 @@ for (const session of sessions) {

const summary = coverageMap.getCoverageSummary().data;
if (coverageThreshold) {
if (config === null || config === void 0 ? void 0 : config.threshold) {
for (const type of exports.coverageTypes) {
const { pct } = summary[type];
if (pct < coverageThreshold[type]) {
if (pct < config.threshold[type]) {
return { coverageMap, summary, passed: false };

@@ -26,0 +26,0 @@ }

@@ -12,2 +12,3 @@ import * as constants from './browser-launcher/constants';

export { EventEmitter } from './utils/EventEmitter';
export { CoverageMapData } from 'istanbul-lib-coverage';
//# sourceMappingURL=index.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TestRunner = void 0;
const path_1 = require("path");
const createTestSessions_1 = require("./createTestSessions");

@@ -22,3 +23,3 @@ const getTestCoverage_1 = require("../coverage/getTestCoverage");

this.config = config;
this.testFiles = testFiles;
this.testFiles = testFiles.map(f => path_1.resolve(f));
this.browserLaunchers = Array.isArray(config.browsers) ? config.browsers : [config.browsers];

@@ -43,3 +44,3 @@ this.scheduler = new TestScheduler_1.TestScheduler(config, this.sessions);

for (const launcher of this.browserLaunchers) {
const names = await launcher.start(this.config);
const names = await launcher.start(this.config, this.testFiles);
if (!Array.isArray(names) || names.length === 0 || names.some(n => typeof n !== 'string')) {

@@ -144,3 +145,3 @@ throw new Error('Browser start must return an array of strings.');

if (this.config.coverage) {
testCoverage = getTestCoverage_1.getTestCoverage(this.sessions.all(), this.config.coverageConfig.threshold);
testCoverage = getTestCoverage_1.getTestCoverage(this.sessions.all(), this.config.coverageConfig);
passedCoverage = testCoverage.passed;

@@ -147,0 +148,0 @@ }

{
"name": "@web/test-runner-core",
"version": "0.6.1",
"version": "0.6.2",
"publishConfig": {

@@ -38,2 +38,3 @@ "access": "public"

"istanbul-lib-coverage": "^3.0.0",
"picomatch": "^2.2.2",
"uuid": "^8.1.0"

@@ -40,0 +41,0 @@ },

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet