-
Notifications
You must be signed in to change notification settings - Fork 56
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
chore: Convert ATs to Vitest #1181
base: main
Are you sure you want to change the base?
Conversation
testTimeout: 30000, | ||
hookTimeout: 20000, |
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 doubt the tests should take this long, I just went a little high to prevent false positives
opts.env = { BROWSER: 'none' }; | ||
} | ||
// Prevent the browser from opening when `open` is called | ||
opts.env = { BROWSER: 'none' }; |
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 removed the check for the headless
config value, because I can't think of why we would want to open browser windows. We don't plan on interacting with them from the tests and all it does is make your system borderline unusable for the duration of the tests.
@@ -66,7 +51,7 @@ const getTestConfig = () => { | |||
} | |||
|
|||
if (!config.cliPath && !config.cliVersion) { | |||
const defaultPath = path.join(process.cwd(), DEFAULT_CLI_PATH); |
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.
DEFAULT_CLI_PATH
was only used in one place and it's relative to the cwd
, so it seem to make more sense to just inline it.
"js-yaml": "^4.0.0", | ||
"rimraf": "^3.0.2", | ||
"uuid": "^10.0.0", |
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.
Add the uuid
lib to help with file name randomization
import rimraf from 'rimraf'; | ||
import { v4 as uuidv4 } from 'uuid'; | ||
|
||
export class TestState { |
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.
This is a helper class to manage all of the state needed to be able to run the tests. It helps to segment the tests so they all have their own copy of the test state and can run in isolation from one another. It handles the generation of a config file with a semi-randomized name so file system collisions should not happen between tests.
|
||
# Acceptance Tests | ||
acceptance-tests/my-project | ||
acceptance-tests/*.yml |
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.
Good call 👍
…ion of another test
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.
Nice! This seems like such a huge upgrade. Everything here looks good to me aside from a few tiny things.
I'm having trouble getting these to run locally. Is there anything special you need to do? Ran yarn
and yarn test
but getting errors
Error: Invalid process path hs
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.
This lgtm! We chatted about this already, but just a reminder that this will cause our "latest publish" tests to fail because it makes them run correctly and there's a bug in hs project create
Description and Context
vitest
open
is calledTODO
Who to Notify
@kemmerle @camden11 @brandenrodgers