File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed
exercises/03.using-jsx/01.solution.compiler Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -29,9 +29,25 @@ await testStep('babel is loaded', () => {
29
29
} )
30
30
31
31
await testStep ( 'JSX is in use' , async ( ) => {
32
+ // Filter out comment lines before checking
33
+ const scriptContent = inlineScript ! . textContent || ''
34
+ const lines = scriptContent . split ( '\n' )
35
+ const nonCommentLines = lines
36
+ . filter ( ( line ) => {
37
+ const trimmed = line . trim ( )
38
+ return (
39
+ ! trimmed . startsWith ( '//' ) &&
40
+ ! trimmed . startsWith ( '/*' ) &&
41
+ ! trimmed . startsWith ( '*' )
42
+ )
43
+ } )
44
+ . join ( '\n' )
45
+
32
46
expect (
33
- inlineScript ! . textContent ,
34
- 'createElement( should not appear in your source' ,
47
+ nonCommentLines ,
48
+ 'createElement( should not appear in your source (excluding comments) ' ,
35
49
) . not . to . include ( 'createElement(' )
36
- expect ( inlineScript ! . textContent , 'JSX is not in use' ) . to . include ( '</div>' )
50
+ expect ( nonCommentLines , 'JSX is not in use (excluding comments)' ) . to . include (
51
+ '</div>' ,
52
+ )
37
53
} )
You can’t perform that action at this time.
0 commit comments