Commit Graph

357 Commits

Author SHA1 Message Date
Thomas Cruveilher
981dd90946
fix(assertRejects): fails on synchronous throw #1302 (#2234)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2022-05-18 13:48:18 +09:00
David Sherret
dfbb3f9e21
fix(testing/bdd): support using bdd tests with dnt (#2235)
fix: support using bdd tests with dnt
2022-05-15 16:33:53 -04:00
Yoshiya Hinosawa
436c3a7b25
test(testing/snapshot): update snapshot expections (#2210) 2022-05-10 19:39:50 +09:00
Ben Heidemann
bab7056ff0
feat(testing/snapshot): add "assertSnapshot" options overload (#2179) 2022-05-06 22:05:27 +09:00
Eliaz Bobadilla
4a44ee3869
docs(testing): document assertFalse in README (#2175) 2022-05-03 22:11:12 +09:00
Ben Heidemann
d9fd8a171a
BREAKING(testing/snapshot): change multiline string serialization (#2166) 2022-05-03 21:21:11 +09:00
Mathis Bullinger
3dd6843571
fix(testing): Compare circular objects (#2172)
The "equal" function keeps track of encountered objects by adding 
them to "seen". Encountered objects must be added to "seen" before 
the first recursive call to "compare" because otherwise the "compare"
function will infinitely recurse when comparing circular objects.
2022-05-01 14:50:44 +02:00
Eliaz Bobadilla
8ee4023df8
feat(testing): assertFalse (#2093) 2022-04-30 20:20:00 +09:00
Ben Heidemann
3103d39fe3
test(testing/snapshot): add regression test for Deno.inspect compacting empty iterables (#2152) 2022-04-27 09:55:37 +09:00
Jesper van den Ende
c258af35ad
feat(testing): infer stub and spy return types from properties (#2137) 2022-04-26 22:34:42 +09:00
Ben Heidemann
0ea7b3f2b3
test(testing/snapshot): fix unexpected truncation of long strings in snapshots (#2150) 2022-04-26 12:54:45 +09:00
David Sherret
f4474d6817
chore: deno fmt with 1.21.0 (#2132) 2022-04-21 00:27:28 -04:00
Yongwook Choi
7b44ec31cd
feat(testing): Implement "assertSnapshot" (#2039)
This commits adds "assertSnapshot" API as part of "testing" module.

This API is modelled after Jest's API and can be used to compare
test results with previously saved result in a file.

Co-authored-by: Ben Heidemann <ben@heidemann.co.uk>
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2022-04-20 13:46:21 +02:00
Kyle June
85950b9219
feat(testing): add TestContext argument to "it" function (#2117) 2022-04-17 01:23:49 +02:00
Kyle June
403f226a20
feat(testing): add utility for faking time (#2069)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-04-14 15:29:17 +09:00
Yoshiya Hinosawa
e224f047ae
BREAKING(testing/bench): deprecate testing/bench module (#2104)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-04-13 21:58:50 +09:00
Kyle June
5f764b9499
feat(testing): add behavior-driven development (#2067) 2022-04-08 14:01:46 +09:00
Jesper van den Ende
c347251139
docs(testing): Fix typo (#2082) 2022-04-05 15:36:41 +02:00
Kyle June
7213d527ec
feat(testing): add mocking utilities (#2048) 2022-03-29 21:51:36 +09:00
Jesper van den Ende
8e01ec6cb7
feat(testing): add assertInstanceOf (#2028) 2022-03-16 14:38:30 +09:00
Jesse Jackson
4e8f0e7bb8
feat(testing/asserts): use assertion signature for "assertStrictEquals" (#1984) 2022-03-04 14:31:19 +09:00
Yasser A.Idrissi
54ddd4a6a3
fix(testing): Misleading assertion error in assertNotEquals (#1989) 2022-03-03 17:40:02 +01:00
Simon Lecoq
91026e5af6
fix(testing): fix assertObjectMatch for RegExp/Map/Set (#1967) 2022-03-03 14:31:25 +09:00
Elisée Maurer
0bda42d822
chore: Enable "noImplicitOverride" compiler option and fix errors (#1940)
This commit makes deno_std "noImplicitOverride"-compliant and 
enables the compiler option in deno.json so that further changes 
don't regress it
2022-02-20 17:35:40 +01:00
Simon Lecoq
3284461e9d
feat(testing): add assertAlmostEquals (#1906) 2022-02-19 19:54:58 +09:00
Yoshiya Hinosawa
808fe203e0
chore: update copyright header (#1871) 2022-02-02 23:21:39 +09:00
Zheyu Zhang
a60fb1c154
fix(testing): assertObjectMatch matches ArrayBuffer views correctly (#1843) 2022-01-26 12:10:01 +09:00
Satoshi
6a14fe29c8
chore(testing): Remove duplicate function call (#1821) 2022-01-13 16:39:47 +01:00
lmx-Hexagram
43c5946774
fix(testing/assert): inequality of -0 and 0 (#1783) 2022-01-04 07:01:24 +01:00
Bartek Iwańczuk
dcad2062d5
[BREAKING] Remove assertThrowsAsync from 'testing/' (#1646) 2021-12-13 14:00:20 +01:00
Yoshiya Hinosawa
7f3710a850
chore: fix jsdoc for deprecated assertThrowsSync (#1593) 2021-11-16 19:24:38 +09:00
Jonah Snider
1d9cd65f95
perf: use Array.from instead of new Array (#1551)
Co-authored-by: Leon Strauss <me@lionc.de>
2021-11-11 10:21:06 +01:00
Christian Petersen
5a89b25862
fix(testing): fix nested array matching for assertObjectMatch (#1289)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-11-11 16:43:02 +09:00
Craig Doremus
2c66f29c2f
doc(testing): update fast-check examples (#1487) 2021-10-30 21:11:39 +02:00
ayame113
50563aca43
fix(testing): show special characters in assertEquals results (#1450) 2021-10-26 18:05:38 +09:00
Kyle June
b84b432fb8
feat(testing): add assertIsError (#1376) 2021-10-24 14:08:48 +09:00
standvpmnt
0e38d24b3d
docs(testing): add example for fast-check (#1413) 2021-10-20 17:17:34 +09:00
c0per
b18ff0f3cb
fix(testing): improve assertObjectMatch (#1419)
fixes https://github.com/denoland/deno_std/issues/1418
2021-10-18 15:36:57 +09:00
Craig Morten
81332ba733
docs(testing): add test examples using sinon and chai (#1334) 2021-10-06 13:30:52 +09:00
Nayeem Rahman
a0994ff888
fix: use strict-ts44.tsconfig.json on release tests (#1278) 2021-09-16 15:13:54 +09:00
Nayeem Rahman
159e2aeffc
feat(testing/asserts): add assertThrows() overload to receive error (#1219) 2021-09-16 00:35:21 +09:00
Craig Morten
c4600fbd75
docs: correct typos (#1207) 2021-09-07 16:40:05 +09:00
Zhangyuan Nie
5facd2743f
fix(testing/asserts): export Constructor type (#1208) 2021-09-07 16:33:02 +09:00
Yoshiya Hinosawa
abec657c67
docs(testing): document assertRejects in README (#1198) 2021-09-07 15:04:00 +09:00
Kitson Kelly
b7c61a27a7
chore: updates related to TypeScript 4.4 (#1171)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2021-08-31 14:39:04 +10:00
David Sherret
2fb3577559
fix(testing): assertEquals now considers constructors equal if one is nullable and the other is Object (#1159) 2021-08-23 18:03:35 -04:00
Ryan Dahl
455077a905
fix: type check examples in README files (#1121)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-08-11 11:28:10 +02:00
Yasser A.Idrissi
eb69dbd380
feat(testing): add assertRejects, deprecate assertThrowsSync (#1101) 2021-08-09 14:59:52 +09:00
Simon Lecoq
5606a10728
fix(testing): change assertThrows and assertThrowsAsync return type to void and Promise<void> (#1052) 2021-07-28 14:54:58 +09:00
Simon Lecoq
7c4017fbad
fix(testing): assertThrowsAsync always reporting Error instead of actual error class (#1051) 2021-07-26 18:58:29 +09:00
Yoshiya Hinosawa
186354327c
chore: enable doc type checking (#1050) 2021-07-23 19:09:38 +09:00
Guilherme J. Tramontina
c27b2593d4
fix(testing/asserts): cater for different class constructor functions (#1000) 2021-07-22 13:53:53 +09:00
Fuji Haruka
1c96a57fdc
Don't merge diff when it's not spaces even if it's surrounded by word-diff (#1032) 2021-07-13 13:40:38 -04:00
Jesse Jackson
91cd23ab81
fix: improve type safety for browser-compatible modules (#995)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2021-07-06 11:15:37 +09:00
Mark Fulton
fe93815008
fix(fail): use return type of never (#1002) 2021-07-05 11:44:09 -04:00
Simon Lecoq
a43cb5b322
feat(testing/asserts): improved strings diff (#948) 2021-06-24 16:58:35 +09:00
Jesse Jackson
ce65e694b0
feat(testing/asserts): use assertion signature for "assertExists" (#969) 2021-06-24 14:46:20 +09:00
Mark Fulton
a4c4dc2c60
fix(testing/asserts): fix handling of Weak* objects (#951) 2021-06-07 16:06:29 +09:00
Yusuke Tanaka
81be5faad9
chore: remove ESLint directives (#941) 2021-05-30 15:25:01 +09:00
Simon Lecoq
71b6522513
fix(testing): support array values in assertObjectMatch (#906) 2021-05-13 17:04:22 +09:00
Simon Lecoq
7e4d6efe24
fix(std/testing): equals does not differentiate undefined/absent keys (#849) 2021-04-14 14:50:48 +09:00
Yasser A.Idrissi
1333c6f916
fix(testing): Function signature of assertObjectEquals() does not accept interfaces #741 (#763)
Co-authored-by: William Perron <hey@wperron.io>
2021-04-05 08:02:59 -04:00
William Perron
69f3d67cb2
chore: remove Promise<void> return type annotation (#819)
There's a couple of instances where `Promise<void>` is still there,
those are the exceptions, for example functions that explicitely return
a `Promise` object or functions that return the promise from another
function call without any `await` statement.

used this one-liner to automatically remove everything:

```bash
grep -rli 'promise<void>' | xargs sed -i 's/: Promise<void>//g
```
2021-04-05 07:49:05 -04:00
Yusuke Tanaka
b134d54319
refactor: fix codes to pass no-unused-vars lint (#764) 2021-03-02 15:31:37 +09:00
Simon Lecoq
b35290541d
fix(std/testing) : Handle Symbols correctly in deep equalities (#731) 2021-02-16 13:23:39 +01:00
Ryan Dahl
48a2496dbe update copyright to 2021 (denoland/deno#9081) 2021-02-01 10:46:59 +00:00
Nayeem Rahman
a0bfd92db8 fix: Don't use JSDoc syntax for browser-compatibility headers (denoland/deno#8960) 2021-02-01 10:46:58 +00:00
William Perron
0ea945721b docs: add missing jsdoc comments to exported functions (denoland/deno#8442)
includes:
- http/file_server.ts
- testing/_diff.ts
- testing/asserts.ts

Relates to denoland/deno#7487
2021-02-01 10:46:58 +00:00
Bartek Iwańczuk
57d903a06b build: migrate to dlint (denoland/deno#8176)
This commit migrates repository from using "eslint" 
to "dlint" for linting JavaScript code.
2021-02-01 10:46:58 +00:00
Yasser A.Idrissi
ee1f8219b7 feat(testing): Add assertExists assertion (denoland/deno#7874) 2021-02-01 10:46:58 +00:00
Tim Reichen
55a7adb58e rename(testing): rename assert*Contains to assert*Includes (denoland/deno#7951)
This commit renames two assertion functions to better align with JS API:
- assertStringContains -> assertStringIncludes
- assertArrayContains -> assertArrayIncludes
2021-02-01 10:46:58 +00:00
Simon Lecoq
75e51cd223 feat(testing): Add support for object assertion against object subset (denoland/deno#8001)
This commit add supports for a new assertion function 
"assertObjectMatch" which allows to test an actual object 
against an expected object subset (i.e. inclusivity, not equality).
2021-02-01 10:46:58 +00:00
tokiedokie
8567b960f8 docs: version all imports in README (denoland/deno#7442)
Use $STD_VERSION in  README files to automatically
display proper version.
2021-02-01 10:46:58 +00:00
Trivikram Kamat
eb1c38cfbf docs: end sentences with a period in markdown (denoland/deno#7813) 2021-02-01 10:46:58 +00:00
tokiedokie
d4dcf633bd refactor(testing): Get rid of default export and make testing/diff.ts private (denoland/deno#7592) 2021-02-01 10:46:58 +00:00
Nayeem Rahman
d80fb379cb feat(cli/console): Add Deno.InspectOptions::colors (denoland/deno#7742)
Ref: https://github.com/denoland/deno/pull/7516#pullrequestreview-489567120
2021-02-01 10:46:58 +00:00
David Sherret
99e0dca320 feat(fmt): Sort named import and export specifiers (denoland/deno#7711) 2021-02-01 10:46:58 +00:00
tokiedokie
d3fa1bbf5d chore: add copyright (denoland/deno#7593) 2021-02-01 10:46:58 +00:00
Casper Beyer
ec04cb2584 fix(cli/console): always quote and escape inspected strings (denoland/deno#7546) 2021-02-01 10:46:58 +00:00
Pig Fang
c08982f09a fix(testing): assertion diff color (denoland/deno#7499) 2021-02-01 10:46:58 +00:00
Christian Petersen
fc70f85d14 fix(testing): invalid dates assertion equality (denoland/deno#7230) 2021-02-01 10:46:58 +00:00
xcatliu
2f39e2eb24 feat(testing): add assertNotMatch (denoland/deno#6775) 2021-02-01 10:46:58 +00:00
Casper Beyer
521dd0834c test(testing): reduce bench test iterations to 1e3 (denoland/deno#7200) 2021-02-01 10:46:58 +00:00
Kitson Kelly
d47cdf14aa feat: update to TypeScript 4.0 (denoland/deno#6514) 2021-02-01 10:46:58 +00:00
Schwarzkopf Balázs
198851ee64 fix(node): misnamed assert exports (denoland/deno#7123) 2021-02-01 10:46:58 +00:00
David Sherret
1425960509 Use dprint for internal formatting (denoland/deno#6682) 2021-02-01 10:46:58 +00:00
Rob Waller
e9e789c933 fix(testing): assertThrows inheritance (denoland/deno#6623) 2021-02-01 10:46:58 +00:00
Nayeem Rahman
26b0fa530f feat(Deno.inspect): Add sorted, trailingComma, compact and iterableLimit to InspectOptions (denoland/deno#6591) 2021-02-01 10:46:58 +00:00
uki00a
221393d449 fix(tesing/asserts): assertEquals/NotEquals should use milliseconds in Date (denoland/deno#6644) 2021-02-01 10:46:58 +00:00
WJH
634fc770a0 improve(asserts): allow assert functions to specify type parameter (denoland/deno#6413) 2021-02-01 10:46:58 +00:00
Bartek Iwańczuk
14b9403143 upgrade: swc_ecma_visit, dprint, deno_lint (denoland/deno#6580) 2021-02-01 10:46:58 +00:00
Yasser A.Idrissi
dbcef80d97 refactor(testing): Remove unuseful statement (denoland/deno#6486) 2021-02-01 10:46:58 +00:00
Casper Beyer
95568a5113 fix(testing) assertArrayContains should work with any array-like (denoland/deno#6402) 2021-02-01 10:46:58 +00:00
Rob Waller
f1f31bc965 fix(testing): assertThrows gracefully fails if non-Error thrown (denoland/deno#6330) 2021-02-01 10:46:58 +00:00
Vladimir Iakovlev
ac76e3c085 Update assertions names in testing README (denoland/deno#6318) 2021-02-01 10:46:58 +00:00
Joel Chippindale
64f0355dfd Fix assertEqual so that it handles URL objects (denoland/deno#6278) 2021-02-01 10:46:58 +00:00
Nayeem Rahman
ccb92613f0 refactor: Don't destructure the Deno namespace (denoland/deno#6268) 2021-02-01 10:46:58 +00:00
Szalay Kristóf
6908dc02f4 fix(testing/bench): Make progress callback async (denoland/deno#6175) 2021-02-01 10:46:57 +00:00
Casper Beyer
eb9127bf38 Rename abbreviated assertions in testing (denoland/deno#6118) 2021-02-01 10:46:57 +00:00
Jon Short
75198c971e feat(testing): Allow non-void promises in assertThrowsAsync (denoland/deno#6052) 2021-02-01 10:46:57 +00:00
Szalay Kristóf
a2608199ae refactor(testing/bench): Remove differentiating on runs count (denoland/deno#6084) 2021-02-01 10:46:57 +00:00
Szalay Kristóf
40b4a97c67 fix(testing/bench): clock assertions without --allow-hrtime (denoland/deno#6069) 2021-02-01 10:46:57 +00:00
Szalay Kristóf
b70486f8bd docs: benchmarking (denoland/deno#6075) 2021-02-01 10:46:57 +00:00
Nayeem Rahman
63f4e7a223 fix(testing/asserts): Format values in assertArrayContains() (denoland/deno#6060) 2021-02-01 10:46:57 +00:00
Szalay Kristóf
beeaf368df feat(testing): benching progress callback (denoland/deno#5941) 2021-02-01 10:46:57 +00:00
Szalay Kristóf
95a10d7abf Return results in benchmark promise (denoland/deno#5842) 2021-02-01 10:46:57 +00:00
Nayeem Rahman
309e1cb6a0 fix(testing/asserts): Support browsers (denoland/deno#5847) 2021-02-01 10:46:57 +00:00
Speykious
659825a0ef Provide better ANSI colorized output when inspecting objects (denoland/deno#5404) 2021-02-01 10:46:57 +00:00
Stéphane Klein
f88c05396d fix(testing): Provide message and diff for assertStrictEq (denoland/deno#5417)
closes denoland/deno#5416
2021-02-01 10:46:57 +00:00
Nayeem Rahman
e4cb19d01d BREAKING: Remove Deno.EOF, use null instead (denoland/deno#4953) 2021-02-01 10:46:57 +00:00
Bartek Iwańczuk
4facff44f2 BREAKING: remove overload of Deno.test() (denoland/deno#4951)
This commit removes overload of Deno.test() that accepted named
function.
2021-02-01 10:46:57 +00:00
Nayeem Rahman
1fcef0d8e7 Remove testing/format.ts (denoland/deno#4749) 2021-02-01 10:46:57 +00:00
Chris Knight
36605613c5 fix(testing/asserts): change left/right to actual/expected (denoland/deno#4697) 2021-02-01 10:46:57 +00:00
Bartek Iwańczuk
3be952f68f remove testing/runner.ts (denoland/deno#4649) 2021-02-01 10:46:57 +00:00
Khải
8fb1aba3ba fix(testing): formatting bigint (denoland/deno#4626) 2021-02-01 10:46:57 +00:00
Nayeem Rahman
e7c907bc7b refactor(cli/js/testing): Reduce testing interfaces (denoland/deno#4451)
* Reduce "testing" interfaces
* Use a callback instead of a generator for Deno.runTests()
* Default RunTestsOptions::reportToConsole to true
* Compose TestMessage into a single interface
2021-02-01 10:46:57 +00:00
Kitson Kelly
7914eae5f0 Update to Prettier 2 and use ES Private Fields (denoland/deno#4498) 2021-02-01 10:46:57 +00:00
Samrith Shankar
204ebc523d Add require-await lint rule (denoland/deno#4401) 2021-02-01 10:46:57 +00:00
Nayeem Rahman
d977bf43d0 fix(http): Fix respond error test on Windows (denoland/deno#4408) 2021-02-01 10:46:57 +00:00
Bartek Iwańczuk
fbf385164b remove testing/runner.ts, use deno test for tests (denoland/deno#4397)
This introduces BREAKING CHANGE by removing "testing/runner.ts".

Std tests are now run using "deno test" subcommand.
2021-02-01 10:46:57 +00:00
Bartek Iwańczuk
9195988b03 fix: testing/runner.ts and deno test (denoland/deno#4392)
After splitting "failFast" and "exitOnFail" arguments, there was a situation where failing tests did not exit with code 1.

* fixed argument value passed to Deno.runTests() in deno test
* fixed argument value passed to Deno.runTests() in testing/runner.ts
* added integration tests for deno test to ensure failFast and exitOnFail work as expected
* don't write test file to file system, but keep it in memory
2021-02-01 10:46:57 +00:00
Bartek Iwańczuk
a19e660a30 feat: Deno.test() sanitizes ops and resources (denoland/deno#4399)
This PR brings assertOps and assertResources sanitizers to Deno.test() API.

assertOps checks that test doesn't leak async ops, ie. there are no unresolved
promises originating from Deno APIs. Enabled by default, can be disabled using 
Deno.TestDefinition.disableOpSanitizer.

assertResources checks that test doesn't leak resources, ie. all resources used
in test are closed. For example; if a file is opened during a test case it must be
explicitly closed before test case finishes. It's most useful for asynchronous
generators. Enabled by default, can be disabled using 
Deno.TestDefinition.disableResourceSanitizer.

We've used those sanitizers in internal runtime tests and it proved very useful in
surfacing incorrect tests which resulted in interference between the tests.

All tests have been sanitized.

Closes denoland/deno#4208
2021-02-01 10:46:57 +00:00
Nayeem Rahman
c8d15ec7b2 refactor: Cleanup options object parameters (denoland/deno#4296) 2021-02-01 10:46:57 +00:00
Chris Knight
53599846fc test: add actual error class to fail message (denoland/deno#4305) 2021-02-01 10:46:57 +00:00
Bartek Iwańczuk
8bd4c5ed4d rename Deno.Err -> Deno.errors (denoland/deno#4093) 2021-02-01 10:46:57 +00:00
Yusuke Sakurai
b490e1199c fix: [ws] sock shouldn't throw eof error when failed to read frame (denoland/deno#4083) 2021-02-01 10:46:57 +00:00
Bartek Iwańczuk
f5cbcf287e refactor: remove unneeded ErrorKinds (denoland/deno#3936) 2021-02-01 10:46:57 +00:00
Bartek Iwańczuk
b9f5505ebe update references to testing/mod.ts in manual (denoland/deno#3973) 2021-02-01 10:46:57 +00:00
Bartek Iwańczuk
82a523639a refactor: rewrite tests in to use Deno.test (denoland/deno#3930) 2021-02-01 10:46:57 +00:00
Yusuke Sakurai
ee8ec4b053 remove non-null assertion operator from std (part1) (denoland/deno#3900) 2021-02-01 10:46:57 +00:00
Ry Dahl
51658155cf feat: Deno.args now does not include script (denoland/deno#3628)
Previously Deno.args was ["script.js", "arg1", "arg2"]
Now it is just ["arg1", "arg2"]
BREAKING CHANGE
2021-02-01 10:46:56 +00:00
Ry Dahl
3a9eb92372 Happy new year! (denoland/deno#3578) 2021-02-01 10:46:56 +00:00
Nayeem Rahman
90bd2ad881 feat: Add missing mod.ts files in std (denoland/deno#3509)
archive/tar.ts:
- Remove FileReader.
- Remove FileWriter.

encoding/csv.ts:
- ExtendedParseOptions -> ParseOptions
- HeaderOption -> HeaderOptions
- ParseOptions -> ReadOptions
- readAll() -> readMatrix()

encoding/yaml.ts:
- DumpOptions -> StringifyOptions

fmt/colors.ts:
- getEnabled() -> getColorEnabled()
- setEnabled() -> setColorEnabled()

testing/mod.ts:
- Re-export sibling modules.
2021-02-01 10:46:56 +00:00
Yoshiya Hinosawa
b04ae5a9b8 Improve empty test case error messages (denoland/deno#3514) 2021-02-01 10:46:56 +00:00
Bartek Iwańczuk
c0623f5afd run std test with cargo test (denoland/deno#3344)
Removes three CI jobs
2021-02-01 10:46:56 +00:00
Nayeem Rahman
0a92976bb0 fix: error handling in fs/walk() (denoland/deno#3318)
- Make assertThrows() return the Error
- Remove WalkOptions::onError()
2021-02-01 10:46:56 +00:00
Kitson Kelly
1c5db631f7 Update to TypeScript 3.7 (denoland/deno#3275)
and update to prettier 1.19

Also, update `assert()` and remove not null assertions where possibly
in `cli`.

Closes denoland/deno#3273
2021-02-01 10:46:56 +00:00
James Wright
1abe6fe8f4 Consolidates asserts#equal branches for keyed collections (Map/Set) and supports deep equality of Map keys (denoland/deno#3258) 2021-02-01 10:46:56 +00:00
James Wright
b26206d217 Support for deep Map equality with asserts#equal (denoland/deno#3236) 2021-02-01 10:46:56 +00:00
Nayeem Rahman
5b2aec7a62 std: Move fs/path to the top-level (denoland/deno#3100) 2021-02-01 10:46:56 +00:00
Ryan Dahl
d491d2e747 Run deno_std tests in github actions 2021-02-01 10:46:56 +00:00
Yoshiya Hinosawa
c3fe858f98 Update eslint and @typescript-eslint (#621) 2019-10-05 12:02:34 -04:00
Nayeem Rahman
8c90bd9d0b Implement expandGlob() and expandGlobSync() (#617)
fs/glob.ts:
- Improve prototypes for expandGlob() and expandGlobSync() from #604.
- Rename glob() to globToRegExp().
- Add normalizeGlob() and joinGlobs().
- Extract GlobToRegExpOptions from GlobOptions, remove the strict
  and filepath options.

fs/globrex.ts:
- Add GlobrexOptions.

fs/path/constants.ts:
- Add SEP_PATTERN.

fs/walk.ts:
- Add WalkOptions::includeFiles
- Default WalkOptions::includeDirs to true.
- Don't traverse directories matching a skip pattern.
- Remove walkSync()'s default root value.

prettier:
- Refactor to use expandGlob().

testing:
- Make findTestModules() an async generator.
2019-10-02 13:59:27 -04:00
Nayeem Rahman
17a214bbd5 Test runner v2 (#604) 2019-09-28 09:33:17 -04:00
Nayeem Rahman
e3a33a79e6 Remove //testing/main.ts (#605) 2019-09-21 14:32:15 -04:00
Axetroy
06958a4ada bump prettier to 1.18.2 (#592) 2019-09-11 23:31:23 -04:00
Bartek Iwańczuk
cfb0eb55ab reenable test getMatchingUrlsLocal (#589) 2019-09-08 17:20:11 -04:00
Ryan Dahl
539338db33
bump ci to v0.17.0 (#585) 2019-09-04 20:10:54 -04:00
Bartek Iwańczuk
5ef42ece7d fix: better paths handling in test runner (#574) 2019-08-30 13:43:32 -04:00
Ryan Dahl
28e77389ff
Move colors to fmt (#571) 2019-08-24 10:38:18 -07:00
Eugen Cazacu
ed1b9e0563 print out the failed tests after the summary (#554) 2019-08-22 03:13:12 -04:00
Bartek Iwańczuk
4531fa8159 fix: add global test registry (#568)
After adding deno test command a new problem appeared.

If you try running deno test inside this repo test runner will find 
80 test files but won't run any tests! This is caused by fact that 
deno test uses tagged version of standard library which causes 
test function available inside to repo to be different function that 
test available in standard lib used by deno test.
2019-08-21 12:34:34 -04:00
Bartek Iwańczuk
15afc61356 add file:// prefix for imports in test runner (#564) 2019-08-15 10:17:08 -04:00
Bartek Iwańczuk
c44e5367bf feat: test runner (#516) 2019-08-14 20:04:56 -04:00
Bartek Iwańczuk
bd146e0188 feat: add overloaded form of unit test declaration (#563) 2019-08-14 16:12:35 -04:00
Bartek Iwańczuk
ff2d7f24db refactor 'assertEquals' (#560)
* merge 'testing/pretty.ts' into 'testing/asserts.ts'
* throw AssertionError in assertEquals
* update misc tests use AssertionError
2019-08-14 10:22:31 -04:00
Nayeem Rahman
5e77e8adc7 Make shebangs Linux compatible (#545) 2019-07-28 11:10:29 +00:00
Rong Sen Ng
ba4210cdb9 typo 2019-06-24 06:08:14 -07:00
Vincent LE GOFF
d44a47a08d Testing: Pretty output + Silent mode (#314) 2019-06-19 05:43:49 -07:00
Axetroy
b04fda30c8 lint: add max line length rules (#507) 2019-06-18 21:22:01 -07:00
Kitson Kelly
2292fbe6b1 Remove console.error from asserts. (#483) 2019-06-06 10:27:55 -04:00
Bartek Iwańczuk
be24677d15 chore: Implement strict mode (#453) 2019-05-30 08:59:30 -04:00
Vincent LE GOFF
ad1b95eaf7 benching: use performance.now (#385) 2019-05-10 10:48:06 -04:00
Vincent LE GOFF
4543b563a9 Eslint fixes (#356)
Make warnings fail
2019-04-24 07:41:22 -04:00
Dmitry Sharshakov
9432d70329 Support Sets in asserts.equals (#350) 2019-04-22 09:39:33 -04:00
Vincent LE GOFF
95ab4e2a3c Fix eslint warnings and small clean ups (#339) 2019-04-14 10:53:19 -04:00
Bartek Iwańczuk
2c119627dc Fix denoland/deno#2064 (#328) 2019-04-09 04:33:22 -04:00
迷渡
7f4dae109e fix usage code syntax error (#318) 2019-04-05 14:19:13 +03:00
Arash Arbabi
a1ceaa6ef7 fix: benchmarks not returning on deno 0.3.4+ (#317) 2019-03-30 15:52:33 -04:00
Ryan Dahl
eb5b1d9f53
Bump CI to v0.3.5 (#312)
Disable bench_test.ts because it hangs.
2019-03-30 15:03:43 -04:00
Vincent LE GOFF
cac060f388 Fix parallel testing (#309)
Fixes #308

Co-authored by @chiefbiiko
2019-03-28 12:29:27 -04:00
Vincent LE GOFF
d9e8953110 testing: turn off exitOnFail by default (#307) 2019-03-26 11:29:12 -04:00
Vincent LE GOFF
e17364b91f Fix assertEquals for RegExp & Date (#305) 2019-03-26 08:15:16 -04:00
Axetroy
59adafe867 fix: wrong usage of assertThrowsAsync which without await keyword (#295) 2019-03-19 13:22:33 -04:00
Vincent LE GOFF
b699fa67be Documentation clean up (#288) 2019-03-18 11:08:01 -04:00
Yoshiya Hinosawa
61af419bbc fix: eslint errors (#265) 2019-03-12 01:51:51 -04:00
chiefbiiko
4de86f04de Move benching into testing. (#258) 2019-03-11 14:21:13 -04:00
Vincent LE GOFF
d4088a1920 Use AssertionError instead of Error in testing (#254) 2019-03-08 16:04:43 -05:00
Ryan Dahl
02274ef48b
testing/asserts: Add unimplemented and unreachable (#248) 2019-03-08 02:32:46 -05:00
Vincent LE GOFF
899ab67cea Add assertNotEquals, assertArrayContains (#246) 2019-03-07 09:08:19 -05:00
Ryan Dahl
4cf39d4a14
Rename assertEq to assertEquals (#242)
After some discussion it was found that assertEquals is more common
in JS (vs assertEqual, assertEq) and sounds better in the negated form:
assertNotEquals vs assertNE.
2019-03-06 19:42:24 -05:00
Vincent LE GOFF
e1d5c00279 Testing refactor (#240) 2019-03-06 16:39:50 -05:00
Andy Hayden
0fc13fffbd Replace deno.land/x/ with deno.land/std/ (#239) 2019-03-06 10:24:53 -05:00
Vincent LE GOFF
c734e32343 Refactor asserts in testing (#227) 2019-03-05 14:58:28 -05:00
Vincent LE GOFF
8fb9f709a6 Use pretty assertEqual in testing (#234) 2019-03-04 20:03:50 -05:00
Kitson Kelly
c0390ade3d Add eslint for linting (#235) 2019-03-04 19:53:35 -05:00
chiefbiiko
41bdd096f0 feat: parallel testing (#224) 2019-03-04 14:19:03 -05:00
Vincent LE GOFF
90871cfca6 Testing add ansi color support from color module (#223) 2019-03-02 14:56:53 -05:00
Ryan Dahl
93e5e0cd14
Bump CI to v0.3.1 (#220) 2019-03-01 02:54:21 -05:00
Andy Hayden
e609f0c7cb Clean up the test failure output (#209) 2019-02-23 11:24:57 -05:00
Bartek Iwańczuk
817a0fb439 Add runIfMain method (#215) 2019-02-23 11:18:43 -05:00
EnokMan
f65fda8336 Fixed non-standard prefix on importing (#216) 2019-02-23 11:13:53 -05:00
bokuweb
ddafcc6572 feat: Add pretty assert (#187) 2019-02-15 11:11:55 -05:00
Ryan Dahl
34ca60376b
Pretty print exceptions (#190)
Explained here:
https://github.com/denoland/deno/issues/1559#issuecomment-462811554
2019-02-12 18:24:29 -05:00
Rob Muhlestein
5119cd3c59 runTests added to docs (#164) 2019-01-29 15:10:40 -05:00
Yoshiya Hinosawa
b792fe8c72 Port prettier (#156) 2019-01-26 23:19:56 -05:00
James Garbutt
c1c18c9469 testing: add fail() (#123) 2019-01-26 06:51:19 -05:00
Ryan Dahl
ec1675a8ca
testing: Don't automatically run on import (#129) 2019-01-24 16:25:13 -05:00
Kitson Kelly
83bb7e99b6 Add assert.throwsAsync() 2019-01-22 08:34:35 -06:00
Kitson Kelly
2f0ca2242f Make testing more matainable 2019-01-22 08:34:35 -06:00