1 | <html>
|
2 | <head>
|
3 | <title>Test</title>
|
4 | <meta charset="utf-8">
|
5 | <link rel="stylesheet" href="../../node_modules/mocha/mocha.css" />
|
6 | <script src="../../node_modules/mocha/mocha.js"></script>
|
7 | <script src="../../node_modules/chai/chai.js"></script>
|
8 | </head>
|
9 | <body>
|
10 | <div id="mocha"></div>
|
11 | <script>
|
12 | expect = chai.expect;
|
13 |
|
14 | describe('Async Tests Failing', function() {
|
15 | it('passes 1', function() {
|
16 | expect(1).to.be.ok;
|
17 | });
|
18 | it('passes 2', function() {
|
19 | expect(2).to.be.ok;
|
20 | });
|
21 | it('passes 3', function() {
|
22 | expect(3).to.be.ok;
|
23 | });
|
24 |
|
25 | it('fails 1', function(done) {
|
26 | setTimeout(function() {
|
27 | expect(false).to.be.true;
|
28 | done();
|
29 | }, 0);
|
30 | });
|
31 |
|
32 | it('fails 2', function(done) {
|
33 | setTimeout(function() {
|
34 | expect(false).to.be.true;
|
35 | done();
|
36 | }, 0);
|
37 | });
|
38 |
|
39 | it('fails 3', function(done) {
|
40 | setTimeout(function() {
|
41 | expect('false').to.equal('true');
|
42 | done();
|
43 | }, 0);
|
44 | });
|
45 | });
|
46 |
|
47 | mocha.run();
|
48 | </script>
|
49 | </body>
|
50 | </html>
|