-
-
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
fix: work with deploy/netlify branch and existing #15
fix: work with deploy/netlify branch and existing #15
Conversation
Codecov Report
@@ Coverage Diff @@
## master #15 +/- ##
=======================================
Coverage 95.45% 95.45%
=======================================
Files 1 1
Lines 22 22
Branches 3 3
=======================================
Hits 21 21
Misses 1 1
Continue to review full report at Codecov.
|
@@ -1,47 +1,95 @@ | |||
import nock from 'nock' | |||
/* eslint import/first: "off" */ |
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.
jest.mock is hoisted--but it's a little cleaner to me by placing it at the top.
Happy to tweak this.
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.
That's fine, thanks
@@ -7,7 +7,8 @@ | |||
"repository": "Developmint/wait-for-netlify-preview", | |||
"scripts": { | |||
"lint": "eslint index.js __test__", | |||
"test": "yarn run lint && jest --detectOpenHandles", | |||
"pretest": "yarn run lint", | |||
"test": "jest --detectOpenHandles", |
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.
Longer term--if main.js
is extracted out into a utility, this would be quite a bit easier to test and this option wouldn't be required.
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 you want, you can do this in another PR 👍
@manniL thanks for the review and merge (and the utility!). Could you let me know when this is published and in which version? Thank you! |
whoa, i just saw this. i still honestly have no idea what the problem is, but if this is a big deal for y’all, please escalate, make noise, and i’ll get someone smarter than me to look at this. if this fix is good, then im happy to leave it alone. just want to establish that we’re happy to help you when needed. |
@sw-yx nope, all good. I'm just trying to write up some stuff on automated accessibility testing. This fix works (I published a fork). I'm mostly just still curious about the reasons for the difference in context names. |
Whew - this was kind of a doozy to get the unit tests passing.
Description
This PR introduces a fix for working on the newer (?) status check descriptions that Netlify exposes.
For example, if we check out the following repo we can see that the deploy preview status check is actually named
deploy/netlify
which will fail the regular expression/^netlify\/.*\/deploy-preview$/
.This fixes this issue, while remaining backwards compatible.
Additionally, I added a test and tweaked the existing tests to complete a little more quickly.
nock
and just mocksoctokit/rest
directlymain.js
is required new each test (jest.isolateModules
)Let me know if you have any questions!
Related
Fixes #14
cc @amberleyromo