Skip to content

Commit

Permalink
test: add debug log (#1650)
Browse files Browse the repository at this point in the history
  • Loading branch information
erezrokah authored Dec 14, 2020
1 parent 95a604a commit 26bcd3a
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions tests/command.deploy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ const { withSiteBuilder } = require('./utils/site-builder')
const SITE_NAME = generateSiteName('netlify-test-deploy-')

const validateContent = async ({ siteUrl, path, content, t }) => {
let actualContent
try {
const response = await fetch(`${siteUrl}${path}`)
if (response.ok) {
actualContent = await response.text()
}
} catch (error) {
// no op
const response = await fetch(`${siteUrl}${path}`)
if (content === undefined) {
t.is(response.status, 404)
return
}
const actualContent = await response.text()
if (!response.ok) {
throw new Error(`Failed getting content: ${response.status} - ${response.statusText} - ${actualContent}`)
}

t.is(actualContent, content)
}

Expand Down

0 comments on commit 26bcd3a

Please sign in to comment.