You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d3aa5fa
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(core): share op prototypes and keep the es5 bundles es5 (#352)
- Build the to, is, has, deep, own, nested, strictly and numeric op tables once and share one prototype per table, instead of redefining 30 to 50 getters on every chain step. IAssertScopeFuncDef moves out of IAssertInst.ts into its own file for the shared tables to use.
- The rebuilt tables also put equal, equals and eq on to and add Chai's at, so expect(5).to.be.at.least(5) works.
- Replace bare Symbol.iterator and Error.captureStackTrace uses with ts-utils helpers or casts so the es5 bundles stay es5, and print accessor properties as [Getter] instead of calling them.
- The default config sets timeout, slow and retries to 2000, 75 and 0 for the suite runner.
[MatchError.Nothing]: "expected {value} to be an Error instance",
30
-
[MatchError.ErrorInstance]: "expected {error} to be an instance of {errorLike}",
31
-
[MatchError.ErrorType]: "expected {error} to be of {errorLike} type"
29
+
[eMatchError.Nothing]: "expected {value} to be an Error instance",
30
+
[eMatchError.ErrorInstance]: "expected {error} to be an instance of {errorLike}",
31
+
[eMatchError.ErrorType]: "expected {error} to be of {errorLike} type"
32
32
};
33
33
34
-
constcThrowsErrors: {[key: number]: MsgSource}={
35
-
[MatchError.Nothing]: null,
36
-
[MatchError.ErrorInstance]: "expected {function} to throw a {errorLike} instance but {error} was thrown",
37
-
[MatchError.ErrorType]: "expected {function} to throw an error of type {errorLike} but threw {error}",
38
-
[MatchError.MessageContains]: "expected {function} to throw an error with a message containing {msgMatch} but it was {message}",
39
-
[MatchError.MessageMatches]: "expected {function} to throw an error with a message matching {msgMatch} but it was {message}",
40
-
[MatchError.MessageEquals]: "expected {function} to throw an error with a message equal to {msgMatch} but it was {message}",
41
-
[MatchError.ErrorInstance|MatchError.MessageContains]: "expected {function} to throw a {errorLike} instance with a message containing {msgMatch} but {error} was thrown",
42
-
[MatchError.ErrorInstance|MatchError.MessageMatches]: "expected {function} to throw a {errorLike} instance with a message matching {msgMatch} but {error} was thrown",
43
-
[MatchError.ErrorInstance|MatchError.MessageEquals]: "expected {function} to throw a {errorLike} instance with a message equal to {msgMatch} but {error} was thrown",
44
-
[MatchError.ErrorType|MatchError.MessageContains]: "expected {function} to throw an error of type {errorLike} with a message containing {msgMatch} but {error} was thrown",
45
-
[MatchError.ErrorType|MatchError.MessageMatches]: "expected {function} to throw an error of type {errorLike} with a message matching {msgMatch} but {error} was thrown",
46
-
[MatchError.ErrorType|MatchError.MessageEquals]: "expected {function} to throw an error of type {errorLike} with a message equal to {msgMatch} but {error} was thrown"
[eMatchError.ErrorInstance]: "expected {function} to throw a {errorLike} instance but {error} was thrown",
37
+
[eMatchError.ErrorType]: "expected {function} to throw an error of type {errorLike} but threw {error}",
38
+
[eMatchError.MessageContains]: "expected {function} to throw an error with a message containing {msgMatch} but it was {message}",
39
+
[eMatchError.MessageMatches]: "expected {function} to throw an error with a message matching {msgMatch} but it was {message}",
40
+
[eMatchError.MessageEquals]: "expected {function} to throw an error with a message equal to {msgMatch} but it was {message}",
41
+
[eMatchError.ErrorInstance|eMatchError.MessageContains]: "expected {function} to throw a {errorLike} instance with a message containing {msgMatch} but {error} was thrown",
42
+
[eMatchError.ErrorInstance|eMatchError.MessageMatches]: "expected {function} to throw a {errorLike} instance with a message matching {msgMatch} but {error} was thrown",
43
+
[eMatchError.ErrorInstance|eMatchError.MessageEquals]: "expected {function} to throw a {errorLike} instance with a message equal to {msgMatch} but {error} was thrown",
44
+
[eMatchError.ErrorType|eMatchError.MessageContains]: "expected {function} to throw an error of type {errorLike} with a message containing {msgMatch} but {error} was thrown",
45
+
[eMatchError.ErrorType|eMatchError.MessageMatches]: "expected {function} to throw an error of type {errorLike} with a message matching {msgMatch} but {error} was thrown",
46
+
[eMatchError.ErrorType|eMatchError.MessageEquals]: "expected {function} to throw an error of type {errorLike} with a message equal to {msgMatch} but {error} was thrown"
47
47
};
48
48
49
49
function_isError(value: any): value is Error{
@@ -142,9 +142,9 @@ export function isErrorFunc<R>(this: IAssertScope, errorLike?: ErrorConstructor
0 commit comments