-
Notifications
You must be signed in to change notification settings - Fork 4
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
refactor tests to be more reliable, use unit tests #281
Comments
it seems like existing tests use some sort of E2E testing with a mocked backend when they should do unit testing. e.g. tests for addRequestFormat() would be a typical unit test that mocks $fetch and verfies the right URL is fetched. It makes sense to have a few E2E test(s) with mocked backend as an integration test, but the majority of tests for all the detailed cases should be tested with unit tests where possible. #280 lays the foundation for a working unit test caes setup based upon docs. Once we have that it would make sense to add unit test coverage for our vue skeleton components, such that the right data input gives the right output. We can do that by defining a test component that defines the data and renders it with renderCustomElements helper + use nuxt test-utils to render the component and verify output is correct. |
#280 has added a first working unit test + necessary setup, so we can start refactoring others based upon this example. everything we can test just by rendering components and verifying the result we should test with a unit test like this |
4c5c319#diff-2ee894bf23aa44ff4ce12a3da8af19ab20180474ebf2176dbe5f2eea3f96dc92 added the config such that we can unit-test with nuxt environment that has the module installed, with that we can finally unit test components. |
added more unit tests in #285 - given the existing pattern this is now easy for further components. I think we can now start overhauling existing tests to apply to this pattern and where not move them into a e2e folder to make clear that those tess are using a regular nuxt instance. |
Tests hard-code some weird port numbers to access itself, this should not be necessary given the documented helpers.
We should refactor things a bit to
The text was updated successfully, but these errors were encountered: