-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
refactor: rewrite deno test, add Deno.test() #3865
Conversation
Once the |
Still a long way to that... That said, having removed |
Makes sense. If that's the purpose, though, we should make the exposed |
Sure, but let's discuss after we land this one. CI still fails on glob expansion on Windows and I don't have a platform to test on 😕 I'm thinking about removing glob functionality completely for now |
Yeah, I never realised how good globrex was. There's nothing that comes close in cargo. For future: Do we have a way of shelling out small bits of work like this to JS? If not, we should. Then maybe we could bring globrex and the glob expander into |
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.
Have you checked that if you insert a failing test into somewhere in cli/js that it will indeed still trigger failure? Same for std?
We need to be careful that we don’t silently ignore test failures when changing the runner.
} | ||
|
||
/// Used for `deno test...` subcommand | ||
const TEST_RUNNER_URL: &str = std_url!("testing/runner.ts"); |
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.
🎉
Certainly, both cases throw as expected. Keep in mind that this PR does not change testing in |
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 - let's move forward with it - I think we need to get feedback. I'll try to cut a release today with it.
Great, once we land, I'll try to get PR with glob handling working |
I think as long as it took a directory it would be fine (e.g. |
deno test
subcommand - no longer requires to download files from internetcli/testing.ts
- this file is a trimmed down copy ofstd/testing/mod.ts
- has onlytest()
andrunTests()
methodjs_unit_test
now usesDeno.test()
to create all test cases instead of relying onstd/testing/mod.ts
(this is just some dog-fooding)deno test
does not support globs expansion and exclusion. One needs to pass a full list of files that should be run - ie. you can still calldeno test */*_test.ts
but it is shell's job to expand the glob.It's really an MVP to take a step back and look at test module to provide essential things to write test. I expect that third party testing frameworks will arise (or be ported from node). So by no means this PR tries to establish a "batteries-included" testing framework.