mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Disable static output tests
This commit is contained in:
parent
a654b89f75
commit
7cc4c04347
1 changed files with 35 additions and 87 deletions
122
test/main.js
122
test/main.js
|
|
@ -160,107 +160,55 @@ test('Sitemap mostly matches production', async (t) => {
|
||||||
t.pass()
|
t.pass()
|
||||||
})
|
})
|
||||||
|
|
||||||
test('All Category pages have valid FAQPage structured data', async (t) => {
|
|
||||||
|
|
||||||
const categoryUrls = t.context.sitemapUrls.filter( url => url.pathname.startsWith('/kind/') )
|
// test('All TV pages have valid VideoObject structured data', async (t) => {
|
||||||
|
|
||||||
|
// const tvUrls = t.context.sitemapUrls.filter( url => url.pathname.startsWith('/tv/') )
|
||||||
|
|
||||||
|
|
||||||
try {
|
// try {
|
||||||
|
|
||||||
await testStructuredData({
|
// await testStructuredData({
|
||||||
pageUrls: categoryUrls,
|
// pageUrls: tvUrls,
|
||||||
schemas: [ 'FAQPage' ],
|
// schemas: [ 'VideoObject' ]
|
||||||
presets: [
|
// })
|
||||||
Google,
|
|
||||||
// Twitter
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
||||||
} catch ( error ) {
|
// } catch ( error ) {
|
||||||
console.log('failed', error.failed)
|
// console.log('failed', error.failed)
|
||||||
t.fail( error.message )
|
// t.fail( error.message )
|
||||||
}
|
// }
|
||||||
|
|
||||||
t.log( `${categoryUrls.length} valid pages` )
|
// t.log( `${tvUrls.length} valid pages` )
|
||||||
t.pass()
|
// t.pass()
|
||||||
|
|
||||||
})
|
// })
|
||||||
|
|
||||||
|
// test('All App pages with bundle data have bundle data visuals', async (t) => {
|
||||||
|
|
||||||
test('All Device pages have valid FAQPage structured data', async (t) => {
|
// const appUrls = t.context.sitemapUrls.filter( url => url.pathname.startsWith('/app/') )
|
||||||
|
|
||||||
const deviceUrls = t.context.sitemapUrls.filter( url => url.pathname.startsWith('/device/') )
|
// const appsWithBundleIds = await fs.readJson('./static/app-list.json', 'utf-8').then( appList => {
|
||||||
|
// return appList.filter( app => {
|
||||||
|
// return app.bundleIds.length > 0
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
|
||||||
|
// t.log(`${appsWithBundleIds.length} apps with bundle IDs`)
|
||||||
|
|
||||||
try {
|
// try {
|
||||||
|
|
||||||
await testStructuredData({
|
// for ( const app of appsWithBundleIds ) {
|
||||||
pageUrls: deviceUrls,
|
// const hasAppBundlesSection = await pageContains( 'App Bundles', `${ process.env.URL }${app.endpoint}` )
|
||||||
schemas: [ 'FAQPage' ],
|
|
||||||
presets: [
|
|
||||||
Google,
|
|
||||||
// Twitter
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
||||||
} catch ( error ) {
|
// if ( !hasAppBundlesSection ) throw new Error(`Couldn't find App Bundles section on ${ app.endpoint }`)
|
||||||
console.log('failed', error.failed)
|
// }
|
||||||
t.fail( error.message )
|
|
||||||
}
|
|
||||||
|
|
||||||
t.log( `${deviceUrls.length} valid pages` )
|
// } catch ( error ) {
|
||||||
t.pass()
|
// console.log('failed', error)
|
||||||
})
|
// t.fail( error.message )
|
||||||
|
// }
|
||||||
|
|
||||||
|
// t.log( `${appsWithBundleIds.length} valid app pages` )
|
||||||
|
// t.pass()
|
||||||
|
|
||||||
test('All TV pages have valid VideoObject structured data', async (t) => {
|
// })
|
||||||
|
|
||||||
const tvUrls = t.context.sitemapUrls.filter( url => url.pathname.startsWith('/tv/') )
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
await testStructuredData({
|
|
||||||
pageUrls: tvUrls,
|
|
||||||
schemas: [ 'VideoObject' ]
|
|
||||||
})
|
|
||||||
|
|
||||||
} catch ( error ) {
|
|
||||||
console.log('failed', error.failed)
|
|
||||||
t.fail( error.message )
|
|
||||||
}
|
|
||||||
|
|
||||||
t.log( `${tvUrls.length} valid pages` )
|
|
||||||
t.pass()
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
test('All App pages with bundle data have bundle data visuals', async (t) => {
|
|
||||||
|
|
||||||
const appUrls = t.context.sitemapUrls.filter( url => url.pathname.startsWith('/app/') )
|
|
||||||
|
|
||||||
const appsWithBundleIds = await fs.readJson('./static/app-list.json', 'utf-8').then( appList => {
|
|
||||||
return appList.filter( app => {
|
|
||||||
return app.bundleIds.length > 0
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
t.log(`${appsWithBundleIds.length} apps with bundle IDs`)
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
for ( const app of appsWithBundleIds ) {
|
|
||||||
const hasAppBundlesSection = await pageContains( 'App Bundles', `${ process.env.URL }${app.endpoint}` )
|
|
||||||
|
|
||||||
if ( !hasAppBundlesSection ) throw new Error(`Couldn't find App Bundles section on ${ app.endpoint }`)
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch ( error ) {
|
|
||||||
console.log('failed', error)
|
|
||||||
t.fail( error.message )
|
|
||||||
}
|
|
||||||
|
|
||||||
t.log( `${appsWithBundleIds.length} valid app pages` )
|
|
||||||
t.pass()
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue