Commit Graph

83 Commits

Author SHA1 Message Date
Yoshiya Hinosawa
8c9b4c6972
fix(assert): fix assertion error message of isError (#6147)
Co-authored-by: eryue0220 <eryue0220@users.noreply.github.com>
2024-10-25 20:04:05 +09:00
denobot
eeb3c9b151
chore: release 2024.09.24 (#6043)
Co-authored-by: kt3k <kt3k@users.noreply.github.com>
2024-09-24 19:25:09 +09:00
Asher Gomez
0b2497f16e
fix: update codebase to work with Deno RC (#6018)
* fix: update codebase to work with Deno RC

* work

* fix

* fix

* fix

* fixes

* work

* update

* fixes

* fix

* revert
2024-09-20 09:29:31 +10:00
ud2
fc06009dbd
fix(assert): accept abstract classes (#5978) 2024-09-17 15:28:22 +09:00
denobot
c5d7930d57
chore: release 2024.09.12 (#5969)
Co-authored-by: kt3k <kt3k@users.noreply.github.com>
2024-09-12 19:18:10 +09:00
Yoshiya Hinosawa
780deafff7
refactor(assert): move unstable assertNever under @std/assert/unstable-never (#5928) 2024-09-11 19:38:13 +09:00
Yoshiya Hinosawa
b3e1ebb75f
refactor(assert,expect): import internal APIs from more specific paths (#5923) 2024-09-09 14:47:32 +09:00
lionel-rowe
766d9c410c
fix(assert): value-equal complex keys (#5914) 2024-09-09 15:01:36 +10:00
lionel-rowe
23b4d2a034
refactor(assert): remove unnecessary getValFromKeyedCollection() (#5921)
* refactor(assert): remove unnecessary getValFromKeyedCollection function

* Use type assertion instead of narrowing w unreachable path
2024-09-09 14:11:27 +10:00
lionel-rowe
2fe19de48f
perf(assert): add fast path for primitive keyed collections in equal() (#5913)
* feat(assert): add fast path for primitive keyed collections

* remove fix for #5912 (to be redone as separate pr)

* add extra-fast-path with Set#symmetricDifference

* Changes from code review
2024-09-07 10:11:42 +10:00
denobot
67e9cfa0ff
chore: release 2024.09.04 (#5908)
Co-authored-by: kt3k <kt3k@users.noreply.github.com>
2024-09-04 19:37:53 +09:00
Ian Bull
3b3a7617ab
refactor(assert,datetime,fmt,io,streams): consistently throw new Error() instead of throw Error() (#5855)
refactor(assert, datetime, fmt, io, streams): use `throw new Error` instead of `throw`

To ensure consistency across the codebase, this commit refactors the
codebase to use `throw new Error` instead of `throw` for throwing
errors.

https://github.com/denoland/std/issues/5854
2024-08-29 08:55:24 +10:00
denobot
2b3683b6fb
chore: release 2024.08.26 (#5824)
Co-authored-by: kt3k <kt3k@users.noreply.github.com>
2024-08-26 17:33:29 +09:00
Asher Gomez
dea7d7701a
docs(archive,assert,cache,cli,encoding,html,http,net,streams,text): remove unstable Markdown alert (#5672)
* docs(archive,cli,html,http,net,streams,text): remove unstable Markdown alert

* update

* fix

* update

* fmt

* fix
2024-08-22 02:55:17 -04:00
Kevin Zou
cb3dd2baa5
docs(assert): add additional example in assertObjectMatch docs (#5703) 2024-08-19 12:38:36 +09:00
Yusuke Tanaka
de9f8d2db1
feat(assert/unstable): add assertNever (#5690)
This commit adds a new function `assertNever` to the `assert` submodule.

This function is particularly useful when we want to check whether we properly
handle all the variants of a discriminated union. Ref:
https://www.typescriptlang.org/docs/handbook/unions-and-intersections.html#union-exhaustiveness-checking

---------

Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2024-08-16 08:10:23 -07:00
denobot
0e4f294cdf
chore: release 2024.08.02 (#5621)
Co-authored-by: kt3k <kt3k@users.noreply.github.com>
2024-08-02 20:27:08 +09:00
Yoshiya Hinosawa
b064ee1212
chore(assert): mark options argument of AssertionError constructor unstable (#5573) 2024-07-30 11:15:52 +09:00
Jesse Jackson
36bc450fd9
feat(assert): add options parameter to AssertionError constructor (#5561)
* feat(assert): add `options` parameter to `AssertionError` constructor

* add basic tests

* simplify tests using `assertThrows`

* add example usage of options parameter

* cleanup

* use strict equality comparison in test

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-07-29 17:46:15 +10:00
denobot
fb950fa0f3
chore: release 2024.07.26 (#5554)
Co-authored-by: kt3k <kt3k@users.noreply.github.com>
2024-07-26 19:45:22 +09:00
Asher Gomez
8efc049ddf
chore(assert): remove redundant constructor example (#5506)
chore(assert): remove constructor example
2024-07-23 12:04:10 +09:00
David Luis
5cff014b02
fix(assert): fix assertObjectMatch() prints arrays as objects (#5503)
fix(assert): fix ssertObjectMatch prints arrays as objects
2024-07-23 12:16:10 +10:00
David Luis
ab8f6a5746
fix(assert): assertObjectMatch doesn't print whole object (#5498)
* fix(assert): `assertObjectMatch` doesn't print whole object

* tweak

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-07-22 09:17:33 +10:00
Asher Gomez
81943c34c7
chore(assert): release assert@1.0.0 (#4989) 2024-07-04 21:26:54 +10:00
Yoshiya Hinosawa
ee4600667f
docs(assert): improve assertObjectMatch docs (#5296) 2024-07-04 18:59:18 +09:00
Yoshiya Hinosawa
29f5612eb1
docs(assert): improve assertNotStrictEquals example (#5295) 2024-07-04 15:40:05 +09:00
Yoshiya Hinosawa
99764a7869
docs(assert): update assertMatch example (#5294) 2024-07-04 15:30:27 +09:00
Asher Gomez
c9a4effda9
test(assert): add "assert() throws if expr is falsy" test (#5267) 2024-07-03 13:38:22 +09:00
denobot
940568c62d
chore: release 2024.07.02 (#5254)
Co-authored-by: kt3k <kt3k@users.noreply.github.com>
2024-07-02 20:43:42 +09:00
Asher Gomez
5803cc9172
BREAKING(assert): remove assert from module names (#5176)
* BREAKING(assert): remove `assert` from module names

* work

* fix

* work

* work

* tweaks

* fix
2024-07-02 13:42:40 +10:00
Asher Gomez
d102a10235
refactor(assert,async,bytes,cli,collections,crypto,csv,data-structures,datetime,dotenv,encoding,expect,fmt,front-matter,fs,html,http,ini,internal,io,json,jsonc,log,media-types,msgpack,net,path,semver,streams,testing,text,toml,ulid,url,uuid,webgpu,yaml): import from @std/assert (#5199)
* refactor: import from `@std/assert`

* update
2024-06-30 08:30:10 +00:00
denobot
652ac701b1
chore: release 2024.06.12 (#5031)
Co-authored-by: kt3k <kt3k@users.noreply.github.com>
2024-06-12 15:22:43 +09:00
Yoshiya Hinosawa
a6781da213
fix(assert): fix tolerance calculation when comparing negative values (#5019) 2024-06-10 20:09:27 +09:00
Asher Gomez
6650a50137
chore(assert): release assert@1.0.0-rc.1 (#4934)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2024-06-03 23:53:30 +10:00
Asher Gomez
c2b5460cef
BREAKING(assert): make unreachable() consistent with @std/assert (#4943)
* BREAKING(assert): make `unreachable()` consistent with `@std/assert`

* fix

* fix
2024-06-03 13:33:17 +00:00
Asher Gomez
e34245bdeb
refactor(assert): minor cleanups (#4941)
* refactor(assert): minor cleanups

* tweaks and suggestions
2024-06-03 23:30:20 +10:00
Yoshiya Hinosawa
c28c34991f
docs(assert): remove outdated API docs (#4937) 2024-06-03 19:53:13 +09:00
Braden MacDonald
527b5d462c
BREAKING(assert): assertAlmostEquals() sets useful tolerance automatically (#4460)
feat(assert): assertAlmostEquals() sets useful tolerance automatically

Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-06-03 16:55:39 +10:00
denobot
b9374d3715
chore: release 2024.06.03 (#4935)
Co-authored-by: kt3k <kt3k@users.noreply.github.com>
2024-06-03 15:44:03 +09:00
Asher Gomez
8b24cc7a40
BREAKING(assert,testing): remove formatter option from assertEquals() (#4893) 2024-06-03 13:37:07 +10:00
Asher Gomez
79d6a70729
docs(assert,cli,data-structures,expect,fmt,front-matter,html,http,jsonc,semver,streams,text,toml,webgpu): add snippet checks in module, function and class docs to doc checker (#4855)
* chore: add snippet checks to module docs

* fix

* work

* tweak
2024-05-31 12:01:46 +10:00
Yoshiya Hinosawa
47c38498eb
docs(assert): improve docs (#4876)
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-05-30 11:38:16 +09:00
denobot
51dc36d563
chore: release 2024.05.22 (#4830)
Co-authored-by: kt3k <kt3k@users.noreply.github.com>
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2024-05-22 19:57:28 +09:00
Asher Gomez
9c32f3a57b
refactor(assert,internal): rename diffstr() to diffStr() (#4758) 2024-05-17 15:32:03 +10:00
denobot
66e8fc9869
chore: release 2024.05.16 (#4755)
Co-authored-by: kt3k <kt3k@users.noreply.github.com>
2024-05-16 20:10:44 +09:00
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