-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test(cli): run unit tests using Deno.test #10330
test(cli): run unit tests using Deno.test #10330
Conversation
This comment has been minimized.
This comment has been minimized.
d8afb36
to
b561be2
Compare
2094d75
to
98a2b3f
Compare
81b830b
to
e254be2
Compare
a951135
to
6724bf5
Compare
WebGPU test is leaking because destroy seemingly doesn't seem to close the resources it owns.
See run https://github.com/denoland/deno/runs/2437592943 I've disabled the test for now. |
It's a bit disconcerting that it started failing after this change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@caspervonb is there anything preventing us from removing unitTest
wrapper completely? I know that it'll be painful and a huge diff, but asking out of curiosity
cli/tests/unit/README.md
Outdated
# Deno runtime tests | ||
|
||
Files in this directory are unit tests for Deno runtime. | ||
|
||
Testing Deno runtime code requires checking API under different runtime | ||
permissions (ie. running with different `--allow-*` flags). To accomplish this | ||
all tests exercised are created using `unitTest()` function. | ||
|
||
```ts | ||
import { unitTest } from "./test_util.ts"; | ||
|
||
unitTest(function simpleTestFn(): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be great to keep this README file, it's especially useful to look up command to run a single test. Please retain it and update the examples.
await runTests({ filter }); | ||
} | ||
|
||
main(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to see it go
Nothing preventing it, we can remove it completely in a follow-up. |
Is the option bag required for that? IIRC most of the tests are already written using single option bag. |
Not required, just nicer imho. unitTest("foobla", {
perms: { read: false, write: true },
}, function() {
// ...
}); |
I see, thanks for the heads up! |
d0e5c96
to
20f811f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, exciting!
This removes the old unit test runner and migrates all unit tests to run with
deno test
instead.