-
Notifications
You must be signed in to change notification settings - Fork 621
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
feat: test runner #516
feat: test runner #516
Conversation
Alright so we need to settle on a couple of things for the MVP:
I agree with @hayd that we should also match:
For now let's skip these options:
|
Is //test.ts dead code now? Remove that. |
Yes. I removed all not needed anymore files. Although in I guess extracting it to separate file and passing datetime as arg could work. |
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.
For reference, here are the equivalent options from Jest:
deno -A https://deno.land/std/testing/runner.ts [OPTIONS] [FILES...] | ||
|
||
OPTIONS: | ||
-q, --quiet Don't show output from test cases |
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.
Prevent tests from printing messages through the console.
|
||
OPTIONS: | ||
-q, --quiet Don't show output from test cases | ||
-f, --failfast Stop test suite on first error |
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.
Alias:
-b
. Exit the test suite immediately uponn
number of failing test suite. Defaults to1
.
-q, --quiet Don't show output from test cases | ||
-f, --failfast Stop test suite on first error | ||
-e, --exclude <FILES...> List of file names to exclude from run. If this options is | ||
used files to match must be specified after "--". |
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.
--testPathIgnorePatterns=[array]
An array of regexp pattern strings that is tested against all tests paths before executing the test. Contrary to
--testPathPattern
, it will only run those test with a path that does not match with the provided regexp expressions.
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.
Also, I’m wondering if -x
would be a better short name for this option if you keep the exclude
name.
Maybe the test runner should have that as a feature/option? |
That's specific action to this repo. Test runner should be agnostic of such things |
|
||
// TODO: change return type to `Promise<void>` once, `runTests` is updated | ||
// to return boolean instead of exiting | ||
export async function main(root: string = cwd()): Promise<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.
Describe the glob behavior in a jsdoc comment
CI now is considerably slower (2:10 on latest master and 3:47 on this branch) |
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.
Yes, great!
@bartlomieju @piscisaureus did you confirm that breaking some random test still breaks the runner? |
Slowness is due to the fact that the TS compiler worker is starting up and shutting down for each test file. |
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 - this is great to have. I confirmed that adding a failing test breaks it.
The test runner is quite slow now. This clearly shows that our TS compiler (cli/compiler/ts.rs) is suboptimal in some way. Let's fix it in core tho.
This PR closes #193
It provides simple test runner that searches recursively for
*_test.js
and*_test.ts
files.I'd prefer to land it ASAP in simplest version and then start bike-shedding based on our needs.
Waiting on #556 to land