-
Notifications
You must be signed in to change notification settings - Fork 83
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
Feature/812 cli command to create test files #860
Feature/812 cli command to create test files #860
Conversation
Thanks for this @fecony ! Actually this is a feature that the core team has been discussing internally, so this pushes it forward! I'd like to hear more from the @boostercloud/booster-core team. Maybe @juanjoman can shed some light on his thoughts (I believe you were the one working on the draft on testing, right Juanjo?) |
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.
Amazing work @fecony!! I would just like to check that we're providing chai
as we're importing it on the generated test. Could you check it? 🙏
{ | ||
packagePath: 'chai', | ||
commaSeparatedComponents: 'expect', | ||
}, | ||
] |
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.
Just have a question, does the project's package.json
includes chai as a dependency? 😮
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.
Hey @juanjoman. That is something I mention in PR description "Test files use chai that is not installed by default in new projects." 😄
I think we should include chai
as dependency because Booster docs use chai
but we don't provide it by default? 😅
- if
chai
is not in theproject.json
dependencies, what we should use asexpect
assertion instead?
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.
@juanjoman I though about importing expect
from ./expect
if it exists, as we might expect it to be here (because it is recommended file)
If not, check if chai
exists and import it instead. But if user doesn't have them? 🤔
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.
oooh sorry @fecony, I didn't read it 😓. I think it's ok then to import it from ./expect
and let the user choose their test library, but we should document that 😄
Closing, as I have no time/knowledge which path to take. 😬
|
Description
CLI command to create example test file.
Will create test file (
simple-test.test.ts
) with following content intest/
folder:Test files use
chai
that is not installed by default in new projects.Changes
new:test
command to generate test fileChecks
- [] Updated documentation accordinglyAdditional Information
Closes #812
This command may be expanded to:
expect.ts
file