diff options
author | Linus Groh <mail@linusgroh.de> | 2021-06-11 20:40:08 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-06-11 21:34:05 +0100 |
commit | 862ba6403738224ce683397d496ac43dcb806e1c (patch) | |
tree | 2adb774b7ad77455113279c280dc59e01d52c33f /Userland/Libraries/LibJS/Tests/builtins/AggregateError | |
parent | 8d77a3297a0722e6f6dcb0ffb564ed016c0cfc20 (diff) | |
download | serenity-862ba6403738224ce683397d496ac43dcb806e1c.zip |
LibJS: Implement the Error Cause proposal
Currently stage 3. https://github.com/tc39/proposal-error-cause
Diffstat (limited to 'Userland/Libraries/LibJS/Tests/builtins/AggregateError')
-rw-r--r-- | Userland/Libraries/LibJS/Tests/builtins/AggregateError/AggregateError.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Tests/builtins/AggregateError/AggregateError.js b/Userland/Libraries/LibJS/Tests/builtins/AggregateError/AggregateError.js index de73e18e3a..1578d823ad 100644 --- a/Userland/Libraries/LibJS/Tests/builtins/AggregateError/AggregateError.js +++ b/Userland/Libraries/LibJS/Tests/builtins/AggregateError/AggregateError.js @@ -56,4 +56,11 @@ describe("normal behavior", () => { }).errors ).toEqual(errors); }); + + test("supports options object with cause", () => { + const cause = new Error(); + const error = new AggregateError([], "test", { cause }); + expect(error.hasOwnProperty("cause")).toBeTrue(); + expect(error.cause).toBe(cause); + }); }); |