ScuttleBot

scuttlebot / tests / e2e / node_modules / playwright / lib / matchers / matcherHint.js
Blame History Raw 45 lines
1
"use strict";
2
var __defProp = Object.defineProperty;
3
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
var __getOwnPropNames = Object.getOwnPropertyNames;
5
var __hasOwnProp = Object.prototype.hasOwnProperty;
6
var __export = (target, all) => {
7
for (var name in all)
8
__defProp(target, name, { get: all[name], enumerable: true });
9
};
10
var __copyProps = (to, from, except, desc) => {
11
if (from && typeof from === "object" || typeof from === "function") {
12
for (let key of __getOwnPropNames(from))
13
if (!__hasOwnProp.call(to, key) && key !== except)
14
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
}
16
return to;
17
};
18
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
var matcherHint_exports = {};
20
__export(matcherHint_exports, {
21
ExpectError: () => ExpectError,
22
isJestError: () => isJestError
23
});
24
module.exports = __toCommonJS(matcherHint_exports);
25
var import_utils = require("playwright-core/lib/utils");
26
class ExpectError extends Error {
27
constructor(jestError, customMessage, stackFrames) {
28
super("");
29
this.name = jestError.name;
30
this.message = jestError.message;
31
this.matcherResult = jestError.matcherResult;
32
if (customMessage)
33
this.message = customMessage + "\n\n" + this.message;
34
this.stack = this.name + ": " + this.message + "\n" + (0, import_utils.stringifyStackFrames)(stackFrames).join("\n");
35
}
36
}
37
function isJestError(e) {
38
return e instanceof Error && "matcherResult" in e && !!e.matcherResult;
39
}
40
// Annotate the CommonJS export names for ESM import in node:
41
0 && (module.exports = {
42
ExpectError,
43
isJestError
44
});
45

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button