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

Add a --node-arguments flags #2090

Closed
GMartigny opened this issue Apr 16, 2019 · 9 comments · Fixed by #2272
Closed

Add a --node-arguments flags #2090

GMartigny opened this issue Apr 16, 2019 · 9 comments · Fixed by #2272
Labels
enhancement new functionality 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt scope:scheduling scope:test-environment

Comments

@GMartigny
Copy link

GMartigny commented Apr 16, 2019

Issuehunt badges

Description

It could be useful to be able to de define the flags of the Node process running AVA. A comment by @novemberborn scratch the surface, but apparently it never got raised as a request.
Any compatible Node flag could be listed.

Adding the --nodeArgs``--node-args--node-arguments to AVA could allow the user to execute Node with some needed flags.
(eg: ava --node-arguments --experimental-report)
It should also be available as an AVA config property:

{
  "ava": {
    "nodeArguments": [
      "--experimental-report",
      "- --custom-arg"
    ]
  }
}

Test Source

process.execArgv.includes("--experimental-policy"); // <= Never true

Environment

  • Ubuntu v16.04
  • Node v11.9.0
  • AVA v1.4.1

IssueHunt Summary

maximelkin maximelkin has been rewarded.

Backers (Total: $60.00)

Submitted pull Requests


Tips


IssueHunt has been backed by the following sponsors. Become a sponsor

@novemberborn
Copy link
Member

Thanks for opening this, @GMartigny. Should it be --node-args though?

@GMartigny
Copy link
Author

@novemberborn, yes you're right since --update-snapshots and --reset-cache are kebab-case.

@GMartigny GMartigny changed the title Add a --nodeArgs flags Add a --node-args flags Apr 19, 2019
@sindresorhus
Copy link
Member

I would prefer --node-arguments. You don't really gain much from shortening it.

It should also be possible to set it as a AVA config property.

@GMartigny GMartigny changed the title Add a --node-args flags Add a --node-arguments flags May 2, 2019
@GMartigny
Copy link
Author

It should also be possible to set it as a AVA config property

As a string, an array or both ?

@novemberborn
Copy link
Member

It should also be possible to set it as a AVA config property

As a string, an array or both ?

Array.

Are there use cases for specifying these flags as a one-off when you run AVA through the CLI, or should we only support them as a config property, since you'd want to use them all the time?

@sindresorhus
Copy link
Member

I would say both. For example, you get a warning that you're using a deprecated Node.js API, but it doesn't show a stack trace, so you need to pass in a certain CLI argument to Node.js to force it to show where the warning came from. You only need that once.

@GMartigny
Copy link
Author

Are there use cases for specifying these flags as a one-off when you run AVA through the CLI

Off the top of my head, I see a difference between running test locally and through CI. Maybe for environment purpose too like no having the same flags on different node versions.

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

@IssueHunt has funded $60.00 to this issue.


@novemberborn novemberborn added this to the v3 milestone Dec 21, 2019
@novemberborn novemberborn removed this from the v3 milestone Jan 5, 2020
novemberborn added a commit that referenced this issue Jan 18, 2020
Supports `nodeArguments` configuration and `--node-arguments` on the CLI. Fixes #2090.

Co-authored-by: Mark Wubben <mark@novemberborn.net>
@issuehunt-oss
Copy link

issuehunt-oss bot commented Jan 18, 2020

@sindresorhus has rewarded $54.00 to @maximelkin. See it on IssueHunt

  • 💰 Total deposit: $60.00
  • 🎉 Repository reward(0%): $0.00
  • 🔧 Service fee(10%): $6.00

@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 Jan 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement new functionality 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt scope:scheduling scope:test-environment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants