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 CORS header and Cache-Control to static serve #672
Add CORS header and Cache-Control to static serve #672
Conversation
🦋 Changeset detectedLatest commit: a143e0c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
The external script test is failing and trying to zero in into it. I'll report back. |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
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.
LGTM Cristian! 🙂
I've modified our eslint to avoid that eslint-disables and I've updated the script spec expect
to use Jest instead of Mocha because we try to always use Jest's one, even in Cypress.
Feel free to merge.
@@ -20,7 +20,7 @@ describe("Script", () => { | |||
.its("moment") | |||
.should("exist") | |||
.then((moment) => { | |||
expect(moment()._isAMomentObject).to.equal(true); | |||
expect(moment()._isAMomentObject).toBe(true); |
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.
🤔 huh, wondering why do you think we should use Jest's expect? cypress
has the chai one already 🤷♂️
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.
Wondering the same!
Just my two cents, @luisherranz: #672 (comment)
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.
It was simply a personal preference, to learn the commands of only one expect
instead of two.
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.
Gotcha!
.its("moment") | ||
.should("exist") | ||
.then((moment) => { | ||
expect(moment()._isAMomentObject).toBe(true); |
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.
I think this could be rewritten like this, right? Just to follow the Cypress way of do things and avoid dealing with jest eslint rules. 🤷
cy.window()
.its("moment")
.should("exist")
.then((moment) => moment()._isAMomentObject)
.should("be.true"); // or .should("equal", true)
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 a good catch @DAreRodz. Like the way it integrates.
What:
Add the CORS and Cache-Control headers to the static serve middleware.
Why:
In order to be able to load static resources across server domains.
How:
koa-static
has this nifty methodsetHeaders
which is designed specifically to add headers at will.Tasks:
Unrelated Tasks
Additional Comments