-
Notifications
You must be signed in to change notification settings - Fork 28
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 some fixture utils ... #151
Conversation
e00c320
to
1a656f6
Compare
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.
I don't know if my comments rise to the level of "request changes" 🤷
tests/utils.ts
Outdated
scenario?: string; | ||
} | ||
) { | ||
let scenario = options?.scenario ?? 'default'; |
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.
I don't like that the default
is the default value for scenario here, because it matters what folder you put the test file in. I feel like you could make this just a plain argument of the function and make it required, rather than part of the options and making it optional
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.
FWIW, I don't find default
being the default too surprising 🙃
…d correctly for all tests, ensuring that the fixture utils work
… are ran from. ignore files do not cascade
d0df66d
to
4a82bb9
Compare
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.
Approved, with a minor suggestion, and also pointing to this related comment.
Btw, if people are concerned by introducing too much of our own testing infrastructure, we could also introduce chai-files
, which is also used in the blueprint tests of ember-cli/ember-source IIRC, and which vitest can utilize. Not sure though if this will help much, as it's concerned about file assertions, not so much about generating fixtures...
tests/utils.ts
Outdated
|
||
export const SUPPORTED_PACKAGE_MANAGERS = ['npm', 'yarn', 'pnpm'] as const; | ||
|
||
export async function fixture( |
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.
I was not sure what this is doing when seeing it used in code, like generating a fixture, asserting against one, or reading it (which is happening here). Maybe rename to readFixture
?
tests/utils.ts
Outdated
scenario?: string; | ||
} | ||
) { | ||
let scenario = options?.scenario ?? 'default'; |
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.
FWIW, I don't find default
being the default too surprising 🙃
…e fixtures / scenarios work
e524cc5
to
0e99425
Compare
…creation of addons will need to propagate through the existing tests but that can happen in other PRs
055732f
to
387847b
Compare
387847b
to
5d2aae9
Compare
and assert that the .prettierrc.js is generated correctly for all tests, ensuring that the fixture utils work
These are util needed for finishing #146
and #153
An example of using these utils can be seen here: #154