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

@playwright/test

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@playwright/test - npm Package Compare versions

Comparing version 1.13.0-next-alpha-jun-21-2021 to 1.13.0-next-alpha-jun-22-2021

@@ -150,4 +150,5 @@ "use strict";

function isError(obj) {
return obj instanceof Error || (obj && obj.__proto__ && obj.__proto__.name === 'Error');
var _a;
return obj instanceof Error || ((_a = obj === null || obj === void 0 ? void 0 : obj.__proto__) === null || _a === void 0 ? void 0 : _a.name) === 'Error' || ((obj === null || obj === void 0 ? void 0 : obj.__proto__) && isError(obj.__proto__));
}
//# sourceMappingURL=serializers.js.map

@@ -212,2 +212,5 @@ "use strict";

http_1.default.get(httpURL, resp => {
if (resp.statusCode < 200 || resp.statusCode >= 400)
reject(new Error(`Unexpected status ${resp.statusCode} when connecting to ${httpURL}.\n` +
`This does not look like a DevTools server, try connecting via ws://.`));
let data = '';

@@ -214,0 +217,0 @@ resp.on('data', chunk => data += chunk);

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

const runner_1 = require("./runner");
const profiler_1 = require("./profiler");
const defaultTimeout = 30000;

@@ -100,2 +101,3 @@ const defaultReporter = process.env.CI ? 'dot' : 'list';

async function runTests(args, opts) {
await profiler_1.startProfiling();
const browserOpt = opts.browser ? opts.browser.toLowerCase() : 'chromium';

@@ -148,2 +150,3 @@ if (!['all', 'chromium', 'firefox', 'webkit'].includes(browserOpt))

const result = await runner.run(!!opts.list, args.map(forceRegExp), opts.project || undefined);
await profiler_1.stopProfiling(undefined);
if (result === 'sigint')

@@ -150,0 +153,0 @@ process.exit(130);

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

for (const fileSuite of this._suite.suites) {
const file = fileSuite.file;
const file = fileSuite._requireFile;
for (const spec of fileSuite._allSpecs()) {

@@ -72,0 +72,0 @@ for (const test of spec.tests) {

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

const suite = new test_1.Suite('');
suite._requireFile = file;
suite.file = file;

@@ -126,0 +127,0 @@ globals_1.setCurrentlyLoadingFileSuite(suite);

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

test._workerHash = `run${this.index}-${digest}-repeat${i}`;
test._id = `${spec._ordinalInFile}@${spec.file}#run${this.index}-repeat${i}`;
test._id = `${spec._ordinalInFile}@${spec._requireFile}#run${this.index}-repeat${i}`;
spec.tests.push(test);

@@ -89,0 +89,0 @@ tests.push(test);

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

for (const fileSuite of rootSuite.suites)
fileSuites.set(fileSuite.file, fileSuite);
fileSuites.set(fileSuite._requireFile, fileSuite);
const outputDirs = new Set();

@@ -213,3 +213,3 @@ const grepMatcher = util_2.createMatcher(config.grep);

rootSuite.findTest(test => {
workers.add(test.spec.file + test._workerHash);
workers.add(test.spec._requireFile + test._workerHash);
});

@@ -216,0 +216,0 @@ console.log();

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

this._only = false;
this._requireFile = '';
this.title = title;

@@ -27,0 +28,0 @@ }

@@ -56,5 +56,6 @@ "use strict";

const location = util_1.callLocation(suite.file);
const ordinalInFile = countByFile.get(suite.file) || 0;
countByFile.set(location.file, ordinalInFile + 1);
const ordinalInFile = countByFile.get(suite._requireFile) || 0;
countByFile.set(suite._requireFile, ordinalInFile + 1);
const spec = new test_1.Spec(title, fn, ordinalInFile, this);
spec._requireFile = suite._requireFile;
spec.file = location.file;

@@ -73,3 +74,4 @@ spec.line = location.line;

const child = new test_1.Suite(title);
child.file = suite.file;
child._requireFile = suite._requireFile;
child.file = location.file;
child.line = location.line;

@@ -76,0 +78,0 @@ child.column = location.column;

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

const util = __importStar(require("util"));
const profiler_1 = require("./profiler");
const util_1 = require("./util");

@@ -73,2 +74,3 @@ const workerRunner_1 = require("./workerRunner");

let workerRunner;
let workerIndex;
process.on('unhandledRejection', (reason, promise) => {

@@ -85,2 +87,4 @@ if (workerRunner)

const initParams = message.params;
workerIndex = initParams.workerIndex;
profiler_1.startProfiling();
workerRunner = new workerRunner_1.WorkerRunner(initParams);

@@ -112,2 +116,4 @@ for (const event of ['testBegin', 'testEnd', 'done'])

}
if (workerIndex !== undefined)
await profiler_1.stopProfiling(workerIndex);
}

@@ -114,0 +120,0 @@ catch (e) {

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

const baseOutputDir = (() => {
const relativeTestFilePath = path_1.default.relative(this._project.config.testDir, spec.file.replace(/\.(spec|test)\.(js|ts)/, ''));
const relativeTestFilePath = path_1.default.relative(this._project.config.testDir, spec._requireFile.replace(/\.(spec|test)\.(js|ts)/, ''));
const sanitizedRelativePath = relativeTestFilePath.replace(process.platform === 'win32' ? new RegExp('\\\\', 'g') : new RegExp('/', 'g'), '-');

@@ -208,3 +208,3 @@ let testOutputDir = sanitizedRelativePath + '-' + sanitizeForFilePath(spec.title);

}
return path_1.default.join(spec.file + '-snapshots', snapshotName);
return path_1.default.join(spec._requireFile + '-snapshots', snapshotName);
},

@@ -211,0 +211,0 @@ skip: (...args) => modifier(testInfo, 'skip', args),

{
"name": "@playwright/test",
"version": "1.13.0-next-alpha-jun-21-2021",
"version": "1.13.0-next-alpha-jun-22-2021",
"description": "Playwright Test",

@@ -5,0 +5,0 @@ "repository": "github:Microsoft/playwright",

@@ -1148,3 +1148,3 @@ /**

*/
viewport: ViewportSize | undefined;
viewport: ViewportSize | null | undefined;

@@ -1151,0 +1151,0 @@ /**

Sorry, the diff of this file is not supported yet