-
Notifications
You must be signed in to change notification settings - Fork 186
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
add chained tests #136
add chained tests #136
Conversation
@crabest is attempting to deploy a commit to the Antiwork Team on Vercel. A member of the Team first needs to authorize it. |
995fff4
to
ecd5f2a
Compare
for less confusion, I named it |
I prefer "after", as it's... shorter! |
Hm where's that coming from, if it's not being imported. But good point, I'll think on it |
Could we overload it? So you could use both? |
we can use both, the "less confusion" just for us humans |
Let's go with after. I think the simple language is critical for adoption. |
renamed to "after", now it should be good! |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Commented. Feature itself looks good! I do think we should update this repo with at least one example that can be run locally and in CI.
ideas from internal discussion:
This would make it even shorter. |
let me in those discussions (: const allAppActions = shortest(['send invoice to company', 'view invoices']) |
agreed! sorry, just a daily catchup call we do for our products; I do want to move them to being public! next week! 10am EST Friday |
10am EST Friday, sadly I would still be at work. |
yep sounds good! |
with those changes, I think let's drop that |
4db2d23
to
ce4aeea
Compare
using your example, this is how it will look like now: const login = 'user can login with email and password'
shortest([login, 'user can modify their account-level refund policy from the default of 30-days to no refunds allowed'])
const loginAsLawyer = '...'
const loginAsContractor = '...'
const allAppActions = ['send invoice to company', 'view invoices'];
shortest([loginAsLawyer, ...allAppActions])
shortest([loginAsContractor, ...allAppActions]) |
Seems like your new changes are not resolving properly. Here's how you can fix it:When making changes to Here's why this issue happens:
We need both because the compiled JavaScript I created a new issue: #205 to fix it. |
Would be good to have a demo using this new feature when you have finished your implementation. |
the example you used is not implemented, only the example above ^ |
Looks good to me. Would be nice to write some new tests using the new chained tests. To prepare for release please update your branch and bump the version to |
0.3.0 imo |
Can we export a test and use it in another test file? |
@crabest You don't need to do this anymore. Once review is done will just merge to main. |
Please merge main to include a new caching feature! |
Done! |
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
Co-authored-by: Sahil Lavingia <[email protected]>
Great work guys! Was just looking to do a pattern like this for longer test workflows |
Made one change: f7dc8df IMO, we should try to avoid "expect" as that's a pre-AI approach to writing tests. The AI can determine this and fail the test of any of the other test conditions (in natural language) failed. |
If you agree, please merge or let me know and I can do so! |
sure, we just need to adjust the the prompt to let it understand to get the expectation the magic string if we didn't pass those exceptions. |
you can merge, I can't! |
For #123, I thought of adding chained tests just like a testA inside testB to let testA depends on testB, but with this approach testA cannot depend on another testC unless testC is between testA and testB.
As a solution we can let the tests seperated but it can depend on multiple tests no matter the position.
Please let me know your thoughts and feedback.