123456789101112131415161718192021222324252627282930313233343536373839 |
- <!-- public/index.html -->
-
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Mocha Tests</title>
-
- <!-- Include Mocha CSS styles -->
- <link rel="stylesheet" href="https://unpkg.com/mocha/mocha.css" />
- </head>
-
- <body>
- <div id="mocha"></div>
-
- <script src="https://unpkg.com/chai/chai.js"></script>
- <script src="https://unpkg.com/mocha/mocha.js"></script>
-
- <script>
- // Set chai.expect as a global variable
- var expect = chai.expect;
-
- // Setup Mocha to use the BDD interface
- mocha.setup('bdd');
- </script>
-
- <!-- Import the sum function -->
- <script src="sum.js"></script>
-
- <!-- Import the tests for the sum function -->
- <script src="sum.test.js"></script>
-
- <script>
- // Run the tests with Mocha
- mocha.run();
- </script>
-
- </body>
- </html>
|