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

Use [scripts.test] for anchor test`? #555

Closed
fanatid opened this issue Jul 28, 2021 · 6 comments
Closed

Use [scripts.test] for anchor test`? #555

fanatid opened this issue Jul 28, 2021 · 6 comments

Comments

@fanatid
Copy link
Contributor

fanatid commented Jul 28, 2021

Source: #550 (comment)

Proposed breaking change:

  • Remove mocha/ts-mocha selection from anchor-cli.
  • Use [scripts.test] as command for anchor test.
  • Add mocha/ts-mocha command to [scripts.test] in templates.
@armaniferrante
Copy link
Member

What if we re-use the existing [scripts] section? There are other commands like this where we probably want to be able to add hooks, like anchor build and so having one table could be more convenient instead of one per override.

[scripts]
test = "<test-cmd-here>"

@fanatid
Copy link
Contributor Author

fanatid commented Jul 28, 2021

Sorry, that did not make my initial message clear! [scripts.test] is confusing. I meant exactly what you pasted:

[scripts]
test = "<test-cmd-here>"

Should we remove mocha/ts-mocha selection? (i.e. always use value from [scripts] section)

@armaniferrante
Copy link
Member

Sorry, that did not make my initial message clear! [scripts.test] is confusing. I meant exactly what you pasted:

[scripts]
test = "<test-cmd-here>"

Should we remove mocha/ts-mocha selection? (i.e. always use value from [scripts] section)

My weak preference is to use it as a default. If [scripts] + test is provided, then to use that as an override. Any reasons to not do this?

@fanatid
Copy link
Contributor Author

fanatid commented Jul 28, 2021

I see only one reason -- it's clear for the developer what command is executed. There also will no surprise that something is broken if [scripts] + test will be added. But this will introduce breaking change 😞

@armaniferrante
Copy link
Member

I see only one reason -- it's clear for the developer what command is executed. There also will no surprise that something is broken if [scripts] + test will be added. But this will introduce breaking change

I do like the explicit nature of this change. If made, we should bundle it with other breaking changes. :)

@fanatid
Copy link
Contributor Author

fanatid commented Jul 30, 2021

Resolved with #550

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants