File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ let result = compiler.rescript.compile(`
13
13
module A = {
14
14
@react.component
15
15
let make = (~a) => {
16
+ // This should yield a warning (unused variable state)
16
17
let state = React.useState(() => 0)
17
18
<div> {React.string(a)} </div>
18
19
}
@@ -46,7 +47,7 @@ if(result.js_code != "") {
46
47
console . log ( '----' ) ;
47
48
if ( result . type === "unexpected_error" ) {
48
49
console . log ( "UNEXPECTED ERROR" ) ;
49
- console . log ( result . msg ) ;
50
+ console . log ( result ) ;
50
51
process . exit ( 1 ) ;
51
52
}
52
53
if ( result . errors && result . errors . length > 0 ) {
@@ -56,6 +57,13 @@ if(result.js_code != "") {
56
57
}
57
58
process . exit ( 1 ) ;
58
59
}
60
+
61
+ if ( result . warnings . length === 0 ) {
62
+ console . log ( "TEST FAILED" ) ;
63
+ console . log ( "The code should have at least one warning." ) ;
64
+ process . exit ( 1 ) ;
65
+ }
66
+
59
67
console . log ( result . js_code ) ;
60
68
console . log ( '-- Playground test complete --' ) ;
61
69
}
You can’t perform that action at this time.
0 commit comments