File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 1
1
// Test all redirects under `/static/_redirects` are reachable
2
2
3
- if ( process . env . BUILD_TARGET === 'tutorial' ) {
4
- console . log ( 'Skipping test-redirects because BUILD_TARGET is tutorial' ) ;
5
- process . exit ( 0 ) ;
6
- }
3
+ const isTutorialBuild = process . env . BUILD_TARGET === 'tutorial' ;
7
4
8
5
import fs from 'node:fs/promises' ;
9
6
@@ -19,6 +16,16 @@ for (const line of content.split('\n')) {
19
16
20
17
const [ from , to ] = line . split ( ' ' ) ;
21
18
19
+ if ( isTutorialBuild && ! to . startsWith ( '/tutorial' ) ) {
20
+ console . log ( `Skipping ${ from } because it's not a tutorial redirect in the tutorial only build` ) ;
21
+ continue ;
22
+ }
23
+
24
+ if ( ! isTutorialBuild && to . startsWith ( '/tutorial' ) ) {
25
+ console . log ( `Skipping ${ from } because it's a tutorial redirect in the non-tutorial build` ) ;
26
+ continue ;
27
+ }
28
+
22
29
if ( to . includes ( ':' ) ) {
23
30
console . warn ( `Ignoring ${ to } because it has a placeholder` ) ;
24
31
continue ;
You can’t perform that action at this time.
0 commit comments