Update npm packages (73 packages including @jqhtml 2.3.36)
Update npm registry domain from privatenpm.hanson.xyz to npm.internal.hanson.xyz 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
58
node_modules/playwright/lib/worker/testInfo.js
generated
vendored
58
node_modules/playwright/lib/worker/testInfo.js
generated
vendored
@@ -31,7 +31,8 @@ __export(testInfo_exports, {
|
||||
StepSkipError: () => StepSkipError,
|
||||
TestInfoImpl: () => TestInfoImpl,
|
||||
TestSkipError: () => TestSkipError,
|
||||
TestStepInfoImpl: () => TestStepInfoImpl
|
||||
TestStepInfoImpl: () => TestStepInfoImpl,
|
||||
emtpyTestInfoCallbacks: () => emtpyTestInfoCallbacks
|
||||
});
|
||||
module.exports = __toCommonJS(testInfo_exports);
|
||||
var import_fs = __toESM(require("fs"));
|
||||
@@ -42,8 +43,19 @@ var import_util = require("../util");
|
||||
var import_testTracing = require("./testTracing");
|
||||
var import_util2 = require("./util");
|
||||
var import_transform = require("../transform/transform");
|
||||
const emtpyTestInfoCallbacks = {
|
||||
onStepBegin: () => {
|
||||
},
|
||||
onStepEnd: () => {
|
||||
},
|
||||
onAttach: () => {
|
||||
},
|
||||
onTestPaused: () => Promise.reject(new Error("TestInfoImpl not initialized")),
|
||||
onCloneStorage: () => Promise.reject(new Error("TestInfoImpl not initialized")),
|
||||
onUpstreamStorage: () => Promise.resolve()
|
||||
};
|
||||
class TestInfoImpl {
|
||||
constructor(configInternal, projectInternal, workerParams, test, retry, onStepBegin, onStepEnd, onAttach, onTestPaused) {
|
||||
constructor(configInternal, projectInternal, workerParams, test, retry, callbacks) {
|
||||
this._snapshotNames = { lastAnonymousSnapshotIndex: 0, lastNamedSnapshotIndex: {} };
|
||||
this._ariaSnapshotNames = { lastAnonymousSnapshotIndex: 0, lastNamedSnapshotIndex: {} };
|
||||
this._interruptedPromise = new import_utils.ManualPromise();
|
||||
@@ -60,10 +72,7 @@ class TestInfoImpl {
|
||||
this.snapshotSuffix = "";
|
||||
this.errors = [];
|
||||
this.testId = test?.id ?? "";
|
||||
this._onStepBegin = onStepBegin;
|
||||
this._onStepEnd = onStepEnd;
|
||||
this._onAttach = onAttach;
|
||||
this._onTestPaused = onTestPaused;
|
||||
this._callbacks = callbacks;
|
||||
this._startTime = (0, import_utils.monotonicTime)();
|
||||
this._startWallTime = Date.now();
|
||||
this._requireFile = test?._requireFile ?? "";
|
||||
@@ -240,7 +249,7 @@ ${(0, import_utils.stringifyStackFrames)(step.boxedStack).join("\n")}`;
|
||||
suggestedRebaseline: result.suggestedRebaseline,
|
||||
annotations: step.info.annotations
|
||||
};
|
||||
this._onStepEnd(payload);
|
||||
this._callbacks.onStepEnd(payload);
|
||||
}
|
||||
if (step.group !== "internal") {
|
||||
const errorForTrace = step.error ? { name: "", message: step.error.message || "", stack: step.error.stack } : void 0;
|
||||
@@ -262,7 +271,7 @@ ${(0, import_utils.stringifyStackFrames)(step.boxedStack).join("\n")}`;
|
||||
wallTime: Date.now(),
|
||||
location: step.location
|
||||
};
|
||||
this._onStepBegin(payload);
|
||||
this._callbacks.onStepBegin(payload);
|
||||
}
|
||||
if (step.group !== "internal") {
|
||||
this._tracing.appendBeforeActionForStep({
|
||||
@@ -338,8 +347,10 @@ ${(0, import_utils.stringifyStackFrames)(step.boxedStack).join("\n")}`;
|
||||
async _didFinishTestFunction() {
|
||||
const shouldPause = this._workerParams.pauseAtEnd && !this._isFailure() || this._workerParams.pauseOnError && this._isFailure();
|
||||
if (shouldPause) {
|
||||
this._onTestPaused({ testId: this.testId, errors: this._isFailure() ? this.errors : [] });
|
||||
await this._interruptedPromise;
|
||||
await Promise.race([
|
||||
this._callbacks.onTestPaused({ testId: this.testId, errors: this._isFailure() ? this.errors : [], status: this.status }),
|
||||
this._interruptedPromise
|
||||
]);
|
||||
}
|
||||
await this._onDidFinishTestFunctionCallback?.();
|
||||
}
|
||||
@@ -367,7 +378,7 @@ ${(0, import_utils.stringifyStackFrames)(step.boxedStack).join("\n")}`;
|
||||
this._tracing.appendBeforeActionForStep({ stepId: stepId2, title: `Attach ${(0, import_utils.escapeWithQuotes)(attachment.name, '"')}`, category: "test.attach", stack: [] });
|
||||
this._tracing.appendAfterActionForStep(stepId2, void 0, [attachment]);
|
||||
}
|
||||
this._onAttach({
|
||||
this._callbacks.onAttach({
|
||||
testId: this.testId,
|
||||
name: attachment.name,
|
||||
contentType: attachment.contentType,
|
||||
@@ -425,10 +436,6 @@ ${(0, import_utils.stringifyStackFrames)(step.boxedStack).join("\n")}`;
|
||||
if (index > 1)
|
||||
relativeOutputPath = (0, import_util.addSuffixToFilePath)(relativeOutputPath, `-${index - 1}`);
|
||||
}
|
||||
const absoluteSnapshotPath = this._applyPathTemplate(kind, subPath, ext);
|
||||
return { absoluteSnapshotPath, relativeOutputPath };
|
||||
}
|
||||
_applyPathTemplate(kind, relativePath, ext) {
|
||||
const legacyTemplate = "{snapshotDir}/{testFileDir}/{testFileName}-snapshots/{arg}{-projectName}{-snapshotSuffix}{ext}";
|
||||
let template;
|
||||
if (kind === "screenshot") {
|
||||
@@ -439,12 +446,15 @@ ${(0, import_utils.stringifyStackFrames)(step.boxedStack).join("\n")}`;
|
||||
} else {
|
||||
template = this._projectInternal.snapshotPathTemplate || legacyTemplate;
|
||||
}
|
||||
const dir = import_path.default.dirname(relativePath);
|
||||
const name = import_path.default.basename(relativePath, ext);
|
||||
const nameArgument = import_path.default.join(import_path.default.dirname(subPath), import_path.default.basename(subPath, ext));
|
||||
const absoluteSnapshotPath = this._applyPathTemplate(template, nameArgument, ext);
|
||||
return { absoluteSnapshotPath, relativeOutputPath };
|
||||
}
|
||||
_applyPathTemplate(template, nameArgument, ext) {
|
||||
const relativeTestFilePath = import_path.default.relative(this.project.testDir, this._requireFile);
|
||||
const parsedRelativeTestFilePath = import_path.default.parse(relativeTestFilePath);
|
||||
const projectNamePathSegment = (0, import_utils.sanitizeForFilePath)(this.project.name);
|
||||
const snapshotPath = template.replace(/\{(.)?testDir\}/g, "$1" + this.project.testDir).replace(/\{(.)?snapshotDir\}/g, "$1" + this.project.snapshotDir).replace(/\{(.)?snapshotSuffix\}/g, this.snapshotSuffix ? "$1" + this.snapshotSuffix : "").replace(/\{(.)?testFileDir\}/g, "$1" + parsedRelativeTestFilePath.dir).replace(/\{(.)?platform\}/g, "$1" + process.platform).replace(/\{(.)?projectName\}/g, projectNamePathSegment ? "$1" + projectNamePathSegment : "").replace(/\{(.)?testName\}/g, "$1" + this._fsSanitizedTestName()).replace(/\{(.)?testFileName\}/g, "$1" + parsedRelativeTestFilePath.base).replace(/\{(.)?testFilePath\}/g, "$1" + relativeTestFilePath).replace(/\{(.)?arg\}/g, "$1" + import_path.default.join(dir, name)).replace(/\{(.)?ext\}/g, ext ? "$1" + ext : "");
|
||||
const snapshotPath = template.replace(/\{(.)?testDir\}/g, "$1" + this.project.testDir).replace(/\{(.)?snapshotDir\}/g, "$1" + this.project.snapshotDir).replace(/\{(.)?snapshotSuffix\}/g, this.snapshotSuffix ? "$1" + this.snapshotSuffix : "").replace(/\{(.)?testFileDir\}/g, "$1" + parsedRelativeTestFilePath.dir).replace(/\{(.)?platform\}/g, "$1" + process.platform).replace(/\{(.)?projectName\}/g, projectNamePathSegment ? "$1" + projectNamePathSegment : "").replace(/\{(.)?testName\}/g, "$1" + this._fsSanitizedTestName()).replace(/\{(.)?testFileName\}/g, "$1" + parsedRelativeTestFilePath.base).replace(/\{(.)?testFilePath\}/g, "$1" + relativeTestFilePath).replace(/\{(.)?arg\}/g, "$1" + nameArgument).replace(/\{(.)?ext\}/g, ext ? "$1" + ext : "");
|
||||
return import_path.default.normalize(import_path.default.resolve(this._configInternal.configDir, snapshotPath));
|
||||
}
|
||||
snapshotPath(...args) {
|
||||
@@ -462,6 +472,15 @@ ${(0, import_utils.stringifyStackFrames)(step.boxedStack).join("\n")}`;
|
||||
setTimeout(timeout) {
|
||||
this._timeoutManager.setTimeout(timeout);
|
||||
}
|
||||
async _cloneStorage(storageFile) {
|
||||
return await this._callbacks.onCloneStorage({ storageFile });
|
||||
}
|
||||
async _upstreamStorage(storageFile, storageOutFile) {
|
||||
await this._callbacks.onUpstreamStorage({ storageFile, storageOutFile });
|
||||
}
|
||||
artifactsDir() {
|
||||
return this._workerParams.artifactsDir;
|
||||
}
|
||||
}
|
||||
class TestStepInfoImpl {
|
||||
constructor(testInfo, stepId, title, parentStep) {
|
||||
@@ -512,5 +531,6 @@ const stepSymbol = Symbol("step");
|
||||
StepSkipError,
|
||||
TestInfoImpl,
|
||||
TestSkipError,
|
||||
TestStepInfoImpl
|
||||
TestStepInfoImpl,
|
||||
emtpyTestInfoCallbacks
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user