mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Skip longer tests outside of porduction
This commit is contained in:
parent
bfaae09ba9
commit
312a3bd04a
1 changed files with 14 additions and 0 deletions
14
test/main.js
14
test/main.js
|
|
@ -6,6 +6,8 @@ import axios from 'axios'
|
||||||
import { structuredDataTest } from 'structured-data-testing-tool'
|
import { structuredDataTest } from 'structured-data-testing-tool'
|
||||||
import { Google, Twitter } from 'structured-data-testing-tool/presets'
|
import { Google, Twitter } from 'structured-data-testing-tool/presets'
|
||||||
|
|
||||||
|
import { isProduction } from '../helpers/environment.js'
|
||||||
|
|
||||||
// require('dotenv').config()
|
// require('dotenv').config()
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -81,6 +83,12 @@ test('Sitemap contains no double slashes in paths', (t) => {
|
||||||
|
|
||||||
|
|
||||||
test('Sitemap mostly matches production', async (t) => {
|
test('Sitemap mostly matches production', async (t) => {
|
||||||
|
if ( !isProduction ) {
|
||||||
|
t.log('🔶 Test skipped')
|
||||||
|
t.pass()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// console.log('t.context.sitemapUrls', t.context.sitemapUrls)
|
// console.log('t.context.sitemapUrls', t.context.sitemapUrls)
|
||||||
|
|
||||||
const theshold = 10
|
const theshold = 10
|
||||||
|
|
@ -181,6 +189,12 @@ test('All Device pages have valid FAQPage structured data', async (t) => {
|
||||||
|
|
||||||
test('All TV pages have valid VideoObject structured data', async (t) => {
|
test('All TV pages have valid VideoObject structured data', async (t) => {
|
||||||
|
|
||||||
|
if ( !isProduction ) {
|
||||||
|
t.log('🔶 Test skipped')
|
||||||
|
t.pass()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const tvUrls = t.context.sitemapUrls.filter( url => url.pathname.startsWith('/tv/') )
|
const tvUrls = t.context.sitemapUrls.filter( url => url.pathname.startsWith('/tv/') )
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue