-
Notifications
You must be signed in to change notification settings - Fork 630
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
tracking: complete std/expect
#3964
Comments
Hey @iuioiua, |
Great! Let us know which ones you'd like to work on, so there's no overlap with other's work. |
As you start working on the async matchers, you might end up fixing #3947 as a side effect. |
@iuioiua I will be picking.
|
Hi @iuioiua @raashidanwar I'll pick expect.assertions
expect.hasAssertions
expect.addSnapshotSerializer
expect.extend |
For sure! Thank you. Please let us know if you need any help with anything. |
Hi, @iuioiua I have a question about is there a way that I can know whether the current |
Can you elaborate? Perhaps, something like this is what you're after. let isTestDone = false;
Deno.test("my test", () => {
...
isTestDone = true;
}); |
Oh, sorry ~ What I mean that is there any methods that know the And Deno.test('test suite', () => {
expect.hasAssertion();
}); this will throw an error, there was no any assertions in test suite function at all . And the following code will pass: Deno.test('test suite', () => {
expect.hasAssertions();
expect(1 + 2).toEqual(3);
}); On the other hand, why I know current test suite function is done or not, thus can throw an error exactly when the test suite function is completed. |
I don't think we have such hook in |
Is there any possibility to add some similar hook in |
Not sure if we are still open to such addition. When the last time we discussed similar topic, we decided to add test steps (See https://docs.deno.com/runtime/manual/basics/testing/#test-steps ). That essentially added hook capability to So maybe it's a bit unlikely we add another hook capability to deno test, but I'm not completely sure. |
It might be non ideal, but maybe we can add support of |
Thanks for the information, but I think it's still not same as I mentioned before. Because |
It's also a good option, and can combine with deno_lint to do some limits. |
I'd like to work on: |
Just out of interest: here the methods are called |
I think this is trying to imitate |
I wonder if it would make sense to rename them to |
The expectation for |
For anyone wanting to contribute, we also need to make the |
Yes, it corresponds to |
I'm considering implementing |
Yes, I'm doing this now. You could try other API. |
on that note, are there plans to improve the type-safety around
Since (I hope this is the right place for this conversation, I couldn't find any other open issues that cover this topic yet) |
The following APIs are currently not yet implemented in
std/expect
:toMatchSnapShot
toMatchInlineSnapShot
toThrowErrorMatchingSnapShot
toThrowErrorMatchingInlineSnapShot
expect.anything
feat(expect): add asymmetric matchers (#3964) #4366expect.any
feat(expect): add asymmetric matchers (#3964) #4366expect.arrayContaining
feat(expect): add asymmetric matchers (#3964) #4366expect.not.arrayContaining
fix(expect): support expect.not.{arrayContaining,objectContaning,stringContaining,stringMatching} #6138expect.closeTo
feat(expect): addexpect.{closeTo, stringContaining, stringMatching}
#4508expect.objectContaining
fix(expect): supportexpect.objectContaining
#6065expect.not.objectContaining
fix(expect): support expect.not.{arrayContaining,objectContaning,stringContaining,stringMatching} #6138expect.stringContaining
feat(expect): addexpect.{closeTo, stringContaining, stringMatching}
#4508expect.not.stringContaining
fix(expect): support expect.not.{arrayContaining,objectContaning,stringContaining,stringMatching} #6138expect.stringMatching
feat(expect): addexpect.{closeTo, stringContaining, stringMatching}
#4508expect.not.stringMatching
fix(expect): support expect.not.{arrayContaining,objectContaning,stringContaining,stringMatching} #6138expect.assertions
fix(expect,internal,testing): supportexpect.assertions
#6032expect.hasAssertions
fix(expect): supportexpect.hasAssertions()
#5901expect.addEqualityTester
feat(expect): addexpect.addEqualityTesters
api. #4255expect.addSnapshotSerializer
feat(expect): supportexpect.addSnapshotSerialize()
api #4537expect.extend
feat(expect): supportexpect.extend()
api #4412For those wanting to contribute, please submit one PR per API.
The text was updated successfully, but these errors were encountered: