File size: 638 Bytes
bdaa473
 
 
 
 
 
 
1
2
3
4
5
6
7
8
const base='https://sharproduction-production-open-tools.static.hf.space';
for(const locale of ['en','ru']){
  const url=`${base}/${locale}/index.html`,response=await fetch(url),body=await response.text();
  const canonical=body.match(/rel="canonical" href="([^"]+)/)?.[1],assets=(body.match(/<article class="card"/g)||[]).length;
  console.log(JSON.stringify({url,status:response.status,canonical,brand:body.includes('SHAR Production'),index:body.includes('index,follow'),assets}));
  if(response.status!==200||canonical!==url||!body.includes('SHAR Production')||!body.includes('index,follow')||assets!==152)process.exitCode=1;
}