You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No feedback on the content of the tests, except to say that in time (and in developer life this will be required), you may find it helpful to replace the production values by connecting instead to a test database of the same shape but containing gibberish content. For example, arbitrary tags like "socket", "shower" etc might change, so replacing these with test environment variables that are created and destroyed within the cycle of the test keep your tests independent from changes in production to content (where the content itself isn't important). An example of where content is important is something like "submit" on a submit button, or "Log in", etc (i.e. values that aren't kept in the database).
This is a neat little library for generating random content of different types - https://chancejs.com.
When running yarn test I currently get 33 failing tests and 45 passing - is this expected? I don't have any experience with Playwright but looks like it's not finding elements that it expected to find, but perhaps I'm running them incorrectly? Here is one representative error message I'm getting:
Thanks for the feedback!
I was wondering about a test db but ended up spending loads of time reading about mocking and never did either. Would I do this by just providing different env variables for the testing suite?
Tests are not supposed to fail but we spent most of yesterday restructuring the site so I'm not suprised about all the failing tests
Definetly intreseted in picking your brains about unit testing/jest with next13/14 if you've got any experience
Cypress for .tsx files since it renders just components as well as whole pages / user flows (but I've not used Playwright, I assume it's similar?)
Jest for .ts files
Building a proper test suite with test db etc can be quite a lot of work, so I agree with the decision to prioritise other things (i.e. building stuff) - the fact you've got tests at all is really good.
The test suite looks great!
No feedback on the content of the tests, except to say that in time (and in developer life this will be required), you may find it helpful to replace the production values by connecting instead to a test database of the same shape but containing gibberish content. For example, arbitrary tags like "socket", "shower" etc might change, so replacing these with test environment variables that are created and destroyed within the cycle of the test keep your tests independent from changes in production to content (where the content itself isn't important). An example of where content is important is something like "submit" on a submit button, or "Log in", etc (i.e. values that aren't kept in the database).
This is a neat little library for generating random content of different types - https://chancejs.com.
When running
yarn test
I currently get 33 failing tests and 45 passing - is this expected? I don't have any experience with Playwright but looks like it's not finding elements that it expected to find, but perhaps I'm running them incorrectly? Here is one representative error message I'm getting:The text was updated successfully, but these errors were encountered: