UNPKG

e2ed

Version:

E2E testing framework over Playwright

24 lines (23 loc) 808 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.stripExtraLogs = void 0; const node_path_1 = require("node:path"); /** * Strip extra Playwright logs. * @internal */ const stripExtraLogs = (text) => { const lines = text.split('\n'); for (let index = 0; index < lines.length; index += 1) { const line = lines[index]; if (line?.includes(`${node_path_1.sep}node_modules${node_path_1.sep}e2ed${node_path_1.sep}test.js:`)) { const startIndex = line.indexOf('›'); const endIndex = line.lastIndexOf('›'); if (startIndex >= 0) { lines[index] = line.slice(0, startIndex) + line.slice(endIndex); } } } return lines.join('\n'); }; exports.stripExtraLogs = stripExtraLogs;