-
Notifications
You must be signed in to change notification settings - Fork 0
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
Typescript project setup #19
Conversation
Set up a node project in a subdirectory of the functional-test repo. We decided we don't want to create a new repo, but in the meantime we don't want to delete the Python functional test suite. Make it a subdirectory instead that will eventually overwrite the Python tests. PER-9318: Write healthcheck test (webclient functional test)
Set up TypeScript, eslint, and add a .gitignore file to the project to ignore node_modules as well as cypress specific files. PER-9318: Write healthcheck test (webclient functional test)
Most files are autogenerated by Cypress. Add the `health.cy.ts` suite that acts as a health check and just asserts true is true. PER-9318: Write healthcheck test
We want this code to be well formatted even if it is just for automated tests. To ensure this, run linting checks when opening pull requests. PER-9318: Write healthcheck test (webclient functional test)
ef8a993
to
79d009b
Compare
Since we're creating JS tests in the same repo as Python tests, every time we open a PR for these tests it will run the Python functional tests as part of the CI process. We probably want to keep running these for Dependabots and any bugfixes that need to be done for the Python test suite, but we don't need to run these every time we update the JS tests.
PER-9318: Write healthcheck test (webclient functional test)
"eslint-config-prettier": "^8.9.0", | ||
"eslint-plugin-cypress": "^2.13.3", | ||
"eslint-plugin-import": "^2.28.0", | ||
"eslint-plugin-prettier": "^5.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.
This plugin means eslint will enforce all the prettier rules, right?
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.
Yes. 👍
js/cypress/fixtures/example.json
Outdated
{ | ||
"name": "Using fixtures to represent data", | ||
"email": "hello@cypress.io", | ||
"body": "Fixtures are a great way to mock data for responses to routes" | ||
} |
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.
If we don't have a clear path to using this file, or the example files under support
, I'd remove them. If we're going to be using them approximately as soon as we start writing real tests, though, then I'd say it's fine to leave them in this PR.
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'm not sure if we're going to use any fixtures since these will be running on actual environments (in other words, no simulated data). I think we might be using support
files to load in environment variables though.
8bfb0c2
to
53d49a1
Compare
We don't need this example file in our project. If we ever need an example file we can have Cypress regenerate it for us. PER-9318: Write healthcheck test (webclient functional test)
Set up the TypeScript version of the functional test. Because we don't want to use another repository, it exists in a subdirectory so the existing functional test suite can still run. A side effect of this is that we are going to be running the old python test suite for every pull request for the TypeScript version until the python version is removed from this repo.
You can run the test suite locally by going into the
js
directory and running:npm install
npm start
Alternatively you can run tests from the cypress UI by running
npm run cypress:open
instead.