@@ -53,8 +53,10 @@ describe('router-ssr-i18n', () => {
5353 const response = await page . goto ( `http://localhost:${ appPort } /zh` , {
5454 waitUntil : [ 'networkidle0' ] ,
5555 } ) ;
56- const body = await response ?. text ( ) ;
57- expect ( body ) . toContain ( '你好,世界' ) ;
56+ if ( process . env . LOCAL_TEST === 'true' ) {
57+ const body = await response ?. text ( ) ;
58+ expect ( body ) . toContain ( '你好,世界' ) ;
59+ }
5860 const text = await page . $ ( '#key' ) ;
5961 const targetText = await page . evaluate ( el => el ?. textContent , text ) ;
6062 expect ( targetText ?. trim ( ) ) . toEqual ( '你好,世界' ) ;
@@ -63,8 +65,10 @@ describe('router-ssr-i18n', () => {
6365 const response = await page . goto ( `http://localhost:${ appPort } /en` , {
6466 waitUntil : [ 'networkidle0' ] ,
6567 } ) ;
66- const body = await response ?. text ( ) ;
67- expect ( body ) . toContain ( 'Hello World' ) ;
68+ if ( process . env . LOCAL_TEST === 'true' ) {
69+ const body = await response ?. text ( ) ;
70+ expect ( body ) . toContain ( 'Hello World' ) ;
71+ }
6872 const text = await page . $ ( '#key' ) ;
6973 const targetText = await page . evaluate ( el => el ?. textContent , text ) ;
7074 expect ( targetText ?. trim ( ) ) . toEqual ( 'Hello World' ) ;
@@ -73,8 +77,10 @@ describe('router-ssr-i18n', () => {
7377 const response = await page . goto ( `http://localhost:${ appPort } /zh/about` , {
7478 waitUntil : [ 'networkidle0' ] ,
7579 } ) ;
76- const body = await response ?. text ( ) ;
77- expect ( body ) . toContain ( '关于' ) ;
80+ if ( process . env . LOCAL_TEST === 'true' ) {
81+ const body = await response ?. text ( ) ;
82+ expect ( body ) . toContain ( '关于' ) ;
83+ }
7884 const text = await page . $ ( '#about' ) ;
7985 const targetText = await page . evaluate ( el => el ?. textContent , text ) ;
8086 expect ( targetText ?. trim ( ) ) . toEqual ( '关于' ) ;
@@ -92,8 +98,10 @@ describe('router-ssr-i18n', () => {
9298 const response = await page . goto ( `http://localhost:${ appPort } /en/about` , {
9399 waitUntil : [ 'networkidle0' ] ,
94100 } ) ;
95- const body = await response ?. text ( ) ;
96- expect ( body ) . toContain ( 'About' ) ;
101+ if ( process . env . LOCAL_TEST === 'true' ) {
102+ const body = await response ?. text ( ) ;
103+ expect ( body ) . toContain ( 'About' ) ;
104+ }
97105 const text = await page . $ ( '#about' ) ;
98106 const targetText = await page . evaluate ( el => el ?. textContent , text ) ;
99107 expect ( targetText ?. trim ( ) ) . toEqual ( 'About' ) ;
0 commit comments