diff options
Diffstat (limited to 'Userland/Libraries/LibJS/Tests/builtins/Math/Math.exp.js')
-rw-r--r-- | Userland/Libraries/LibJS/Tests/builtins/Math/Math.exp.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Tests/builtins/Math/Math.exp.js b/Userland/Libraries/LibJS/Tests/builtins/Math/Math.exp.js new file mode 100644 index 0000000000..d7111be916 --- /dev/null +++ b/Userland/Libraries/LibJS/Tests/builtins/Math/Math.exp.js @@ -0,0 +1,13 @@ +test("basic functionality", () => { + expect(Math.exp).toHaveLength(1); + + expect(Math.exp(0)).toBe(1); + expect(Math.exp(-2)).toBeCloseTo(0.135335); + expect(Math.exp(-1)).toBeCloseTo(0.367879); + expect(Math.exp(1)).toBeCloseTo(2.718281); + expect(Math.exp(2)).toBeCloseTo(7.389056); + + expect(Math.exp()).toBeNaN(); + expect(Math.exp(undefined)).toBeNaN(); + expect(Math.exp("foo")).toBeNaN(); +}); |