Skip to content

Commit

Permalink
Revert "fix(gatsby): refresh browser when receiving update and runtim…
Browse files Browse the repository at this point in the history
…e errored (#27467)" (#28034)

This reverts commit f227e85.
  • Loading branch information
pieh authored Nov 13, 2020
1 parent ff805c6 commit 076b59f
Show file tree
Hide file tree
Showing 19 changed files with 5 additions and 449 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

27 changes: 2 additions & 25 deletions e2e-tests/development-runtime/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Cypress.Commands.add(`lifecycleCallOrder`, expectedActionCallOrder =>
if (expectedActionCallOrderLength > actionsLength) {
return false
}

let prevActionIndex = -1
for (let i = 0; i < actionsLength; i += 1) {
const nextActionIndex = prevActionIndex + 1
Expand Down Expand Up @@ -81,29 +81,6 @@ Cypress.Commands.add(
}
)

Cypress.Commands.add(`assertRoute`, route => {
Cypress.Commands.add(`assertRoute`, (route) => {
cy.url().should(`equal`, `${window.location.origin}${route}`)
})

// react-error-overlay is iframe, so this is just convenience helper
// https://www.cypress.io/blog/2020/02/12/working-with-iframes-in-cypress/#custom-command
Cypress.Commands.add(`getOverlayIframe`, () => {
// get the iframe > document > body
// and retry until the body element is not empty
return (
cy
.get(`iframe`, { log: true, timeout: 150000 })
.its(`0.contentDocument.body`)
.should(`not.be.empty`)
// wraps "body" DOM element to allow
// chaining more Cypress commands, like ".find(...)"
// https://on.cypress.io/wrap
.then(cy.wrap, { log: true })
)
})

Cypress.Commands.add(`assertNoOverlayIframe`, () => {
// get the iframe > document > body
// and retry until the body element is not empty
return cy.get(`iframe`, { log: true, timeout: 15000 }).should(`not.exist`)
})
1 change: 0 additions & 1 deletion e2e-tests/development-runtime/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ module.exports = {
},
`gatsby-source-fake-data`,
`gatsby-transformer-sharp`,
`gatsby-transformer-json`,
{
resolve: `gatsby-transformer-remark`,
options: {
Expand Down
1 change: 0 additions & 1 deletion e2e-tests/development-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"gatsby-plugin-sharp": "^2.0.37",
"gatsby-seo": "^0.1.0",
"gatsby-source-filesystem": "^2.0.33",
"gatsby-transformer-json": "^2.4.14",
"gatsby-transformer-remark": "^2.3.12",
"gatsby-transformer-sharp": "^2.1.19",
"isomorphic-fetch": "^2.2.1",
Expand Down
18 changes: 1 addition & 17 deletions e2e-tests/development-runtime/scripts/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,13 @@ const args = yargs
`
).trim(),
type: `string`,
})
.option(`restore`, {
default: false,
type: `boolean`,
}).argv

async function update() {
const history = await getHistory()

const { file: fileArg, replacements, restore } = args
const { file: fileArg, replacements } = args
const filePath = path.resolve(fileArg)
if (restore) {
const original = history.get(filePath)
if (original) {
await fs.writeFile(filePath, original, `utf-8`)
} else if (original === false) {
await fs.remove(filePath)
} else {
console.log(`Didn't make changes to "${fileArg}". Nothing to restore.`)
}
history.delete(filePath)
return
}
let exists = true
if (!fs.existsSync(filePath)) {
exists = false
Expand Down

This file was deleted.

Loading

0 comments on commit 076b59f

Please sign in to comment.