mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
feat: introduce puppeteer/Errors (#3056)
This patch adds a new require, `puppeteer/Errors`, that holds all the Puppeteer-specific error classes. Currently, the only custom error class we use is `TimeoutError`. We'll expand in future with `CrashError` and some others. Fixes #1694.
This commit is contained in:
@@ -108,7 +108,12 @@ const DefaultMatchers = {
|
||||
pass: Math.abs(value - other) < Math.pow(10, -precision),
|
||||
message
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
toBeInstanceOf: function(value, other, message) {
|
||||
message = message || `${value.constructor.name} instanceof ${other.name}`;
|
||||
return { pass: value instanceof other, message };
|
||||
},
|
||||
};
|
||||
|
||||
function stringify(value) {
|
||||
|
||||
Reference in New Issue
Block a user