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

Add instructions on how to run the tests #42

Open
amcewen opened this issue Sep 7, 2021 · 2 comments
Open

Add instructions on how to run the tests #42

amcewen opened this issue Sep 7, 2021 · 2 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@amcewen
Copy link
Member

amcewen commented Sep 7, 2021

With #37 and #15 we now have some test infrastructure.

How do I run the tests? I'd expect there to be a line or two of description in README.md to give me the basics, in the same way that there are instructions for setting up the database or running the development server.

For extra credit, a section explaining how to add a new test ("create a file in tests, you can use X as a template; then add any data into the test database by creating a file like Y in Z") would encourage more of us to write more tests 😁

@amcewen amcewen added bug Something isn't working documentation Improvements or additions to documentation labels Sep 7, 2021
@JackiePease
Copy link
Contributor

I have updated the README.md file to add the following lines:
npm run test (or npm tests or npm t) runs .js files in the test subfolder. You can use one of the existing files e.g. app.test.js as a template (first set the NODE_ENV environment variable to 'testing' and run npx knex install:latest to use the latest version of the test database)
However, there don't seem to be any relevant migrations to set up data in the 'testing' database at the moment. Will look into further.

@amcewen
Copy link
Member Author

amcewen commented Jan 3, 2023

Should this still be open, or are the instructions in the README.md and documentation/testing.md sufficient?

(I had to remove the api/node_modules folder to get npm run test-api to run for me, otherwise it failed when trying to run some test in api/node_modules/a-sync-waterfall/test.js - which presumably it shouldn't have been running)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants