-
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
Support ignore: boolean
for Other Test Definition
#7173
Comments
Ref #4351 (comment), I guess we can reconsider now. Yes, we would do this by adding a third options argument to the other overload: export function test(
name: string,
fn: () => void | Promise<void>,
options?: Omit<TestDefinition, "name" | "fn">,
): void; |
I don't see why... |
With adding the ability to skip tests, we're needing to replace // from
Deno.test({ name: c.name, async fn() { stdout.write(c.new_name) })
// to
Deno.test({name: c.new_name, async fn() { runTest() }) Though they aren't really the same as one does not allow options? |
The supposed behaviour difference between the two overloads was a false alarm resolved in IRC. @ebebbington could you edit all of that out? I also kind of wish we only had the object overload, and agree people should just use that. On the other hand, isn't it actually a simpler and slightly less opinionated design if both overloads supported the same option set? By having a third options argument which fills in those missing from the positional args. |
Both are seen as the 'same', yet usage of them isn't (and i guess different internally because the string def doesnt pass anny of the options to the test runner?), and it seems odd to have two things that do the 'exact same' thing @nayeemrmn edited my description 👍 |
@ebebbington I mean can you edit out everything starting with |
Realised adding ignore won't change anything for my use case. I'm happy toclose this issue as the description for the issue is tarnishing what seems like the actual issue of adding ignore, so it. can be closed, unless you wish to keep discussing the ignore options between yourselves |
It would be nice if the deno test runner would allow itself or other modules to improve the output formatting - all in the name of readability, especially for large apps that are running dozens and dozens of tests, the output can be hard to read/structure |
Description
It would be a huge help if the following test definition could support ignoring:
The reason why i'm suggesting this is because of Rhum - we (after numerous days, albeit a while back) managed to finally complete integration tests for asserting output when using Rhum. Below is an example of how test output shows:
Now I am working on adding skip functionality, but
Deno.test(name, fn)
def doesn't allow it, meaning i have to use the object definition.The problem with this is, i'm having to construct the output (programatically) in a different way to support skipping tests, so if test isn't skipped, do the usual, else modify the output so it's compatible with the object definition. Alongside this, it's been impossible to have working integration tests when using the object definition. The main reason is we use
\n
's and\u0008
when formatting the test names, which has been impossible to assert the actual output.I know you already have 2 test definitions, but it would be a great help to Rhum to have both support
ignore
.Other Notes
This is how we run a users' tests:
But when using:
The raw output is completely different when using the obj def, because we have to adjust how to display the test output, meaning our assertions are wrong, and the formatting of the 'new name' needs to be re-written, which has proven near impossible to do
The text was updated successfully, but these errors were encountered: