@@ -4,35 +4,30 @@ import { describe, expect, it } from 'vitest'
44
55const { resolve } = createResolver ( import . meta. url )
66
7- process . env . NODE_ENV = 'production'
8- await setup ( {
9- rootDir : resolve ( '../fixtures/basic' ) ,
10- build : true ,
11- nuxtConfig : {
12- site : {
13- env : 'staging' , // staging blocks
14- url : 'https://example.com' ,
15- } ,
7+ describe ( 'query override' , async ( ) => {
8+ process . env . NODE_ENV = 'production'
9+ await setup ( {
10+ rootDir : resolve ( '../fixtures/basic' ) ,
11+ build : true ,
12+ nuxtConfig : {
13+ site : {
14+ env : 'staging' , // staging blocks
15+ url : 'https://example.com' ,
16+ } ,
1617
17- robots : {
18- debug : true ,
18+ robots : {
19+ debug : true ,
20+ } ,
1921 } ,
20- } ,
21- } )
22-
23- describe ( 'query override' , ( ) => {
22+ } )
2423 it ( 'robots.txt' , async ( ) => {
2524 // blocked by default
2625 expect ( await $fetch ( '/robots.txt' ) ) . toContain ( '(indexing disabled)' )
2726 // but can be overridden
28- expect ( await $fetch ( '/robots.txt' , {
29- params : {
30- mockProductionEnv : true ,
31- } ,
32- } ) ) . toContain ( '(indexable)' )
27+ expect ( await $fetch ( '/robots.txt?mockProductionEnv=true' ) ) . toContain ( '(indexable)' )
3328 } )
3429 it ( 'page' , async ( ) => {
3530 const homeResponse = await $fetch ( '/' )
36- expect ( homeResponse . match ( / < m e t a n a m e = " r o b o t s " c o n t e n t = " ( . * ) " > / ) ?. [ 1 ] ) . toMatchInlineSnapshot ( `" noindex, nofollow"` )
31+ expect ( homeResponse . match ( / < m e t a n a m e = " r o b o t s " c o n t e n t = " ( [ ^ " ] * ) " > / ) ?. [ 1 ] ) . toBe ( ' noindex, nofollow' )
3732 } )
3833} )
0 commit comments