OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
domenic
2017/04/28 20:12:02
General style guidelines: the Microsoft tests have
| |
3 <head> | |
4 <title>html-script-module-compilation-error-1</title> | |
5 <script src="/resources/testharness.js"></script> | |
6 <script src="/resources/testharnessreport.js"></script> | |
7 </head> | |
8 <body> | |
9 <h1>html-script-module-compilation-error-1</h1> | |
10 <script> | |
11 | |
12 setup({allow_uncaught_exception: true}); | |
13 | |
14 window.addEventListener("error", ev => log.push(ev.error)); | |
15 | |
16 var log = []; | |
17 | |
18 var test_load = async_test("test_load"); | |
domenic
2017/04/28 20:12:02
Test names should be informative, e.g. "Syntax err
| |
19 window.addEventListener("load", test_load.step_func_done(ev => { | |
20 assert_equals(log.length, 2); | |
domenic
2017/04/28 20:12:02
This should be 5, I believe. The script is in an e
neis
2017/05/02 13:51:59
Done.
| |
21 assert_true(log[0] instanceof SyntaxError); | |
domenic
2017/04/28 20:12:02
This might be better as assert_equals(log[0].const
| |
22 assert_true(log.every(exn => exn === log[0])); | |
domenic
2017/04/28 20:12:02
For assert_true, I like giving a message so that i
| |
23 })); | |
domenic
2017/04/28 20:12:02
Since this is a single test, you can omit the asyn
neis
2017/05/02 13:51:59
I wasn't able to make this work. Even without call
| |
24 | |
25 </script> | |
26 <script type="module" src="./syntaxerror.js"></script> | |
domenic
2017/04/28 20:12:02
We should add onerror="assert_unreached('1st')" et
neis
2017/05/02 13:51:59
assert_unreached() didn't work for me, that's why
| |
27 <script type="module" src="./syntaxerror.js"></script> | |
28 <script type="module" src="./syntaxerror-nested.js"></script> | |
29 <script type="module" src="./syntaxerror.js"></script> | |
30 <script type="module" src="./syntaxerror-nested.js"></script> | |
31 </body> | |
32 </html> | |
OLD | NEW |