Skip to content
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 arguments in "require" configuration #1666

Closed
novemberborn opened this issue Jan 28, 2018 · 37 comments · Fixed by #3184
Closed

Support arguments in "require" configuration #1666

novemberborn opened this issue Jan 28, 2018 · 37 comments · Fixed by #3184
Assignees
Labels
enhancement new functionality 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt scope:internals

Comments

@novemberborn
Copy link
Member

novemberborn commented Jan 28, 2018

Issuehunt badges

Prompted by #1665 and inspired by Babel's plugin / preset configuration, it'd be neat to do this:

"ava": {
  "require": [
    ["@babel/register", {
      "ignore": ["test/*"]
    }]
  ]
}

If an array is provided we'd require the module, resolve any __esModules / default shenanigans, and invoke .apply() with the remaining values. We should support any number of arguments.


IssueHunt Summary

sculpt0r sculpt0r has been rewarded.

Backers (Total: $40.00)

Submitted pull Requests


Tips

@Jolo510
Copy link

Jolo510 commented Feb 11, 2018

Hey @novemberborn, I'd like to take on this task!

@novemberborn
Copy link
Member Author

@Jolo510 awesome, go for it!

@anayaml
Copy link

anayaml commented Sep 15, 2018

Hey, @novemberborn, I'd like to work on this task

@novemberborn
Copy link
Member Author

@amslv awesome, thanks!

Since this issue was opened, we added support for ava.config.js files. We need to make sure the arguments can be stringified as JSON and then parsed in the worker processes.

We could do the stringifying and the parsing in the main process first, and then use our "deep equal" logic to make sure the values are the same:

const result = concordance.compare(actual, expected, concordanceOptions);

@issuehunt-oss issuehunt-oss bot added the 💵 Funded on Issuehunt This issue has been funded on Issuehunt label May 10, 2019
@IssueHuntBot
Copy link

@IssueHunt has funded $40.00 to this issue.


@stavalfi
Copy link
Contributor

stavalfi commented Feb 6, 2020

@novemberborn

I don't understand your comment. are you proposing a way to solve this issue? if yes, can you explain in different way?

@amslv awesome, thanks!

Since this issue was opened, we added support for ava.config.js files. We need to make sure the arguments can be stringified as JSON and then parsed in the worker processes.

We could do the stringifying and the parsing in the main process first, and then use our "deep equal" logic to make sure the values are the same:

const result = concordance.compare(actual, expected, concordanceOptions);


I did some research and it seems that i must create a temp-js-file that will contain the call to @babel/register with all it's options and add it to the ava.require section.

do you think my idea is ok?

@novemberborn
Copy link
Member Author

@stavalfi I'm not sure what your question is. Could you rephrase it?

@niteshsarode
Copy link

@novemberborn Is anyone working on this issue? Can I give it a try?

@novemberborn
Copy link
Member Author

@niteshsarode please do!

@Om-Vg
Copy link

Om-Vg commented Jul 31, 2020

@novemberborn I would like to give this a try if no-one's working on it

@novemberborn
Copy link
Member Author

@OMLAKSHMI yes, that'd be great, thanks.

@niteshsarode please do let us know if you are about to submit a pull request 😄

@novemberborn novemberborn assigned Om-Vg and unassigned niteshsarode Aug 1, 2020
@webobite
Copy link

Hi @novemberborn
I would like to give it a try. Will let u know If I am able to solve this issue.

Thanks

@webobite
Copy link

@amslv awesome, thanks!

Since this issue was opened, we added support for ava.config.js files. We need to make sure the arguments can be stringified as JSON and then parsed in the worker processes.

We could do the stringifying and the parsing in the main process first, and then use our "deep equal" logic to make sure the values are the same:

const result = concordance.compare(actual, expected, concordanceOptions);

I would like to ask you about this comment. As in this Comment You stated about the main process One need to compare the JSON(arguments) and then use the deepEqual from assert.js (Correct me If I am wrong). As I am new to this repo Can You let me know where exactly the main process code block is there. I tried to trace it from index,js --> worker/main.js --> and then it goes on to chain () call ...
I am new to openSource community.
So Is their any documentation resource (You can point out if available) to understand the specifically workflow of the AVA testing framework which can be used here ?

@novemberborn
Copy link
Member Author

The main process is what loads the configuration. Essentially we can add a validation step before this return:

return config;

You wouldn't use assert.js itself. Load Concordance instead and use the compare() function. I don't think you'd need to pass any options.

@yliu481
Copy link

yliu481 commented Jan 22, 2021

Hi, @novemberborn

Can I work on this issue? I would like to give it a try.

Thanks

@novemberborn novemberborn assigned basker26 and unassigned dudeman9801 Oct 13, 2021
@novemberborn
Copy link
Member Author

@abhnvgupta thanks for letting us know @abhnvgupta, better luck next time! 😄

@thyrhone
Copy link

thyrhone commented Mar 2, 2022

is it still possible to work on this?

@novemberborn novemberborn assigned thyrhone and unassigned basker26 Mar 2, 2022
@novemberborn
Copy link
Member Author

@thyrhone all yours.

@rhit-valentwa rhit-valentwa removed their assignment Jan 7, 2023
@sculpt0r
Copy link
Contributor

sculpt0r commented Feb 25, 2023

Hey @novemberborn , I assume this issue is free to take now? Could you tell me if there is anything special here - since there is a lot of people resign from doing this?

@Avelas1234

This comment was marked as off-topic.

@Avelas1234

This comment was marked as off-topic.

@Avelas1234

This comment was marked as off-topic.

@novemberborn
Copy link
Member Author

@sculpt0r yep. No I don't think there's anything special about it.

@sculpt0r
Copy link
Contributor

So @novemberborn - could you assign me to to this ticket?

@novemberborn
Copy link
Member Author

@sculpt0r just start the work, I doubt anybody will jump in before you.

@1shubhankar9
Copy link

@novemberborn could you assign me to this ticket

@BT616
Copy link

BT616 commented May 1, 2023

Can i try this task?

@novemberborn
Copy link
Member Author

This will land in #3184.

@utkarsh-shrivastav77
Copy link

Hi is this issue still open

@novemberborn
Copy link
Member Author

No, this will land in #3184.

@avajs avajs locked as resolved and limited conversation to collaborators May 24, 2023
@issuehunt-oss issuehunt-oss bot added 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt and removed 💵 Funded on Issuehunt This issue has been funded on Issuehunt labels Jun 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement new functionality 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt scope:internals
Projects
None yet
Development

Successfully merging a pull request may close this issue.