|
1 | | -<!DOCTYPE html> |
| 1 | +<!doctype html> |
2 | 2 | <html> |
3 | | -<head> |
4 | | - <!-- add mocha css, to show results --> |
5 | | - <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mocha/3.2.0/mocha.css"> |
6 | | - <!-- add mocha framework code --> |
7 | | - <script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/3.2.0/mocha.js"></script> |
8 | | - <script> |
9 | | - // enable bdd-style testing |
10 | | - mocha.setup('bdd'); |
11 | | - </script> |
12 | | - <!-- add chai --> |
13 | | - <script src="https://cdnjs.cloudflare.com/ajax/libs/chai/3.5.0/chai.js"></script> |
14 | | - <script> |
15 | | - // chai has a lot of stuff, let's make assert global |
16 | | - let assert = chai.assert; |
17 | | - </script> |
18 | | -</head> |
| 3 | + <head> |
| 4 | + <!-- tilføj mocha css, for at vise resultater --> |
| 5 | + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mocha/3.2.0/mocha.css" /> |
| 6 | + <!-- tilføj mocha framework kode --> |
| 7 | + <script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/3.2.0/mocha.js"></script> |
| 8 | + <script> |
| 9 | + mocha.setup('bdd'); // minimal setup |
| 10 | + </script> |
| 11 | + <!-- add chai --> |
| 12 | + <script src="https://cdnjs.cloudflare.com/ajax/libs/chai/3.5.0/chai.js"></script> |
| 13 | + <script> |
| 14 | + // chai har mange funktioner, lad os gøre assert global |
| 15 | + let assert = chai.assert; |
| 16 | + </script> |
| 17 | + </head> |
19 | 18 |
|
20 | | -<body> |
| 19 | + <body> |
| 20 | + <script> |
| 21 | + function pow(x, n) { |
| 22 | + /* funktionens kode skal skrives, tom for nu */ |
| 23 | + } |
| 24 | + </script> |
21 | 25 |
|
22 | | - <script> |
23 | | - function pow(x, n) { |
24 | | - /* function code is to be written, empty now */ |
25 | | - } |
26 | | - </script> |
| 26 | + <!-- scriptet med testene (describe, it...) --> |
| 27 | + <script src="test.js"></script> |
27 | 28 |
|
28 | | - <!-- the script with tests (describe, it...) --> |
29 | | - <script src="test.js"></script> |
30 | | - |
31 | | - <!-- the element with id="mocha" will contain test results --> |
32 | | - <div id="mocha"></div> |
33 | | - |
34 | | - <!-- run tests! --> |
35 | | - <script> |
36 | | - mocha.run(); |
37 | | - </script> |
38 | | -</body> |
| 29 | + <!-- HTML-elementet med id="mocha" vil indeholde testresultater --> |
| 30 | + <div id="mocha"></div> |
39 | 31 |
|
| 32 | + <!-- kør testene! --> |
| 33 | + <script> |
| 34 | + mocha.run(); |
| 35 | + </script> |
| 36 | + </body> |
40 | 37 | </html> |
0 commit comments