Commit Graph

38 Commits

Author SHA1 Message Date
Asher Gomez
0c44d968a2
refactor(assert): vendor code from fmt/colors.ts (#4716)
* refactor(assert): vendor code from `fmt/colors.ts`

* update

* tweak

* tweaks
2024-05-15 15:00:04 +10:00
Asher Gomez
656eddaf77
docs(assert): document assertStrictEquals() equality comparison behavior (#4724)
doc(assert): document `assertStrictEquals()` equality comparison behavior
2024-05-15 12:46:11 +09:00
Asher Gomez
6769253142
chore(assert): revert "handle assertStrictEquals(-0, +0) correctly" (#4718) 2024-05-13 17:50:51 +10:00
Rüdiger Herrmann
ba0522aba0
fix(assert): handle assertStrictEquals(-0, +0) correctly (#4715)
fix(assert): let assertStrictEquals(-0, +0) pass (#4714)

Fix `assertStrictEquals` to consider -0 and +0 to be equal. Follow the
[MDN recommendation] by replacing `Object.is` with `===` and handling
NaNs specifically.

[MDN recommendation]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness#when_to_use_object.is_versus_triple_equals
2024-05-13 08:41:41 +10:00
Asher Gomez
668c99a41f
fix(assert): don't swallow the original error while creating assertion error (#4701)
fix(assert): remove unreachable logic
2024-05-09 15:39:21 +09:00
Yoshiya Hinosawa
4c769f8175
chore(assert,fmt,fs,internal,path): skip yanked versions manually (#4683) 2024-05-07 16:26:05 +09:00
Michael Herzner
b649680328
test(assert): improve test coverage (#4679)
* test(assert): improve test coverage

* chore: format

* chore: lint

* nits

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-05-07 00:08:16 +00:00
Yoshiya Hinosawa
8c9e96c402
chore: skip yanked versions (#4660) 2024-04-30 20:06:28 +09:00
Yoshiya Hinosawa
3155f0050a
chore: switch to JSR-oriented codebase (#4650) 2024-04-29 11:57:30 +09:00
Asher Gomez
f57ac69735
refactor(assert,expect): use shared format.ts and diff.ts (#4592) 2024-04-16 17:09:40 +10:00
Asher Gomez
46d9fa594c
chore: update browser-compatible files with declaration (#4560) 2024-04-10 12:43:44 +10:00
Gabriele Belluardo
2990aa6de5
chore: enable single-var-declarator lint rule (#4488) 2024-03-14 22:18:00 +11:00
Asher Gomez
021323eba6
docs(assert): add module example (#4439) 2024-03-05 14:57:27 +11:00
lionel-rowe
0a5f52b08e
feat(assert): optional reason param for unreachable (#4404) (#4405) 2024-02-29 06:58:02 +12:00
Asher Gomez
27517a8578
docs: link to assertThrows() and assertRejects() (#4395) 2024-02-26 18:58:17 +00:00
cin
67fe57c295
fix(expect): align toEqual to jest (#4246) 2024-01-29 17:55:56 +09:00
Simon Holloway
76012637b8
refactor(assert): prepare for noUncheckedIndexedAccess (#4045) 2024-01-10 22:20:02 +11:00
Asher Gomez
c35855e712
refactor(assert): remove void return types (#4124) 2024-01-08 13:36:07 +11:00
Lino Le Van
c46143f0ac
chore: update copyright year (#4046)
* chore: update copyright year

* fix

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-01-02 08:11:32 +11:00
Simon Holloway
00e24ecc93
feat(expect): support message checks in expect().toThrow (#3938) 2023-12-12 23:45:58 +09:00
Jesse Jackson
5468fb8ece
fix(assert): export parameter type alias for assertArrayIncludes() (#3917) 2023-12-09 13:56:09 +11:00
scarf
7e0c9debb1
refactor(assert): correct test names, part 2 (#3913) 2023-12-09 01:04:29 +09:00
scarf
9b9be2a25a
test(assert): correct test names (#3911) 2023-12-08 18:06:27 +09:00
lionel-rowe
1946760234
fix(assert): disallow scalar string args in assertArrayIncludes() (#3910)
* fix(assert): Disallow scalar string args to assertArrayIncludes

* Update assert/assert_array_includes_test.ts

Co-authored-by: scarf <greenscarf005@gmail.com>

---------

Co-authored-by: scarf <greenscarf005@gmail.com>
2023-12-08 19:04:06 +11:00
Asher Gomez
84a1373b39
chore(assert): complete documentation (#3900) 2023-12-07 04:13:38 +11:00
Asher Gomez
733b60e4b2
chore(fmt): replace stripColor() use with stripAnsiCode() (#3902) 2023-12-06 17:58:42 +11:00
Asher Gomez
18b2cf4a3b
chore(assert): copy _format.ts to std/expect (#3886) 2023-12-01 13:09:06 +11:00
Yoshiya Hinosawa
4b0eac0d1a
fix(assert): fix diff of long string in objects (#3867) 2023-11-28 15:46:01 +09:00
realpha
b69c28f491
refactor(assert): replace DiffTypeEnum with const object (#3844) 2023-11-24 17:05:44 +09:00
Nikolay Karadzhov
998fb62c00
feat(assert): improve assertion message of assertNotStrictEquals() (#3820) 2023-11-21 05:08:35 +11:00
Yoshiya Hinosawa
3b79ccf5c2
fix(assert): fix swapping of multiline str diff (#3685) 2023-10-04 10:43:58 +09:00
hugoalh
b2c52b2612
docs(assert/assert_false): fix incorrect JSDoc placement (#3626)
Fix incorrect JSDoc placement
2023-09-06 21:23:52 +09:00
(◕ᴥ◕)
10f1323ef7
feat(assert): add inequality asserts (#3496) 2023-08-30 14:35:32 +09:00
Jeff Hykin
ff192484b4
fix(assert): properly quote strings in assertIsError (#3577)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-08-29 20:23:07 +09:00
Lino Le Van
2b5d71224f
refactor: cleanup usage of double equals (#3566)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-08-25 18:04:43 +09:00
Yoshiya Hinosawa
ee6856c2ed
refactor: move _util/diff to assert/_diff (#3563) 2023-08-23 16:45:32 +09:00
denobot
4d4a29b12a
0.198.0 (#3532)
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2023-08-10 14:34:05 +05:30
Asher Gomez
239e85ad6a
BREAKING(testing, assert): move std/testing/asserts to std/assert (#3445) 2023-07-13 16:04:30 +09:00