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
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