summaryrefslogtreecommitdiff
path: root/school/node_modules/node-forge/nodejs/test/browser.js
blob: a96b2d639e3444387d9160132c2a9ac30724d9bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
var server = require('../server');
var grunt = require('grunt');

describe('browser', function() {
  it('should run tests', function(done) {
    this.timeout(60 * 1000 * 5);

    return server.main(function(err, info) {
      if(err) {
        return done(err);
      }

      grunt.initConfig({
        mocha: {
          all: {
            options: {
              reporter: 'List',
              urls: ['http://localhost:' + info.port + '/index.html']
            }
          }
        }
      });

      grunt.loadNpmTasks('grunt-mocha');

      grunt.registerInitTask('default', function() {
        grunt.task.run(['mocha']);
      });
      grunt.tasks(['default'], {
        //debug: true
      }, function() {
        if(err) {
          return done(err);
        }
        // finish immediately
        done(null);
        return info.server.close();
      });
    });
  });
});