mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-21 06:54:08 -07:00
Log url differences
This commit is contained in:
parent
dee78219db
commit
8a3f711413
1 changed files with 9 additions and 2 deletions
11
test/main.js
11
test/main.js
|
|
@ -83,7 +83,7 @@ test('Sitemap contains no double slashes in paths', (t) => {
|
||||||
test('Sitemap mostly matches production', async (t) => {
|
test('Sitemap mostly matches production', async (t) => {
|
||||||
// console.log('t.context.sitemapUrls', t.context.sitemapUrls)
|
// console.log('t.context.sitemapUrls', t.context.sitemapUrls)
|
||||||
|
|
||||||
const theshold = 1
|
const theshold = 10
|
||||||
|
|
||||||
const urlsNotOnLive = new Set()
|
const urlsNotOnLive = new Set()
|
||||||
// const newLocalUrls = new Set()
|
// const newLocalUrls = new Set()
|
||||||
|
|
@ -109,8 +109,15 @@ test('Sitemap mostly matches production', async (t) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const message = `${ urlsNotOnLive.size } new or missing from live and ${ liveSitemapUrls.size } not found locally`
|
const message = `${ urlsNotOnLive.size } new or missing from live and ${ liveSitemapUrls.size } not found locally`
|
||||||
|
const totalDifferences = urlsNotOnLive.size + liveSitemapUrls.size
|
||||||
|
|
||||||
if ( (urlsNotOnLive.size + liveSitemapUrls.size) >= theshold ) {
|
|
||||||
|
if ( totalDifferences >= 0 ) {
|
||||||
|
t.log( 'Missing from live', urlsNotOnLive )
|
||||||
|
t.log( 'Not found locally', liveSitemapUrls )
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( totalDifferences >= theshold ) {
|
||||||
t.fail( message )
|
t.fail( message )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue