bigbite / wp-cypress

WordPress end to end testing with Cypress.io.
MIT License
86 stars 19 forks source link

Code formatting and tests #85

Closed ampersarnie closed 2 years ago

ampersarnie commented 2 years ago

Description

To ensure that we're moving forward for v1.0.0 release and putting ourselves in a better position with subsequent releases, some changes have been required for formatting and general maintenance. Formatting now follows the prettier standard to ensure that formatting is consistent. Jest tests have been added for utilities - though not for all areas this gives us a good start. Huskey has been updated to allow for tests to be run on push as well as linting checks.

I have also removed the yarn.lock file to encourage more use of npm rather than yarn as a standard.

Change Log

Checklist (if applicable):

con322 commented 2 years ago

Nice pr :)

I tried running the jest tests and a couple failed. The error looked to be the same for all of them see below.

screenshot

ampersarnie commented 2 years ago

Nice pr :)

I tried running the jest tests and a couple failed. The error looked to be the same for all of them see below.

screenshot

Looks like Jest is catching the Cypress tests as well. I'll look into exclusion paths.

ampersarnie commented 2 years ago

@con322 This should be fixed now if you would like to review again.

con322 commented 2 years ago

@ampersarnie failed tests have gone from 13 to 9 but some are still failing.

image

ampersarnie commented 2 years ago

Spoke with Connor about the above, issues were differences in setup and Babel transforms on Node v12 providing false reports for coverage. Node v14 and v16 are known to work. Seen the issue also reported here; https://github.com/facebook/jest/issues/10740