Fix: merge conflict
[myslice.git] / third-party / codemirror-3.15 / test / run.js
1 #!/usr/bin/env node
2
3 var lint = require("./lint/lint");
4
5 lint.checkDir("mode");
6 lint.checkDir("lib");
7 lint.checkDir("addon");
8 lint.checkDir("keymap");
9
10 var ok = lint.success();
11
12 var files = new (require('node-static').Server)('.');
13
14 var server = require('http').createServer(function (req, res) {
15   req.addListener('end', function () {
16     files.serve(req, res);
17   });
18 }).addListener('error', function (err) {
19   throw err;
20 }).listen(3000, function () {
21   var child_process = require('child_process');
22   child_process.exec("which phantomjs", function (err) {
23     if (err) {
24       console.error("PhantomJS is not installed. Download from http://phantomjs.org");
25       process.exit(1);
26     }
27     var cmd = 'phantomjs test/phantom_driver.js';
28     child_process.exec(cmd, function (err, stdout) {
29       server.close();
30       console.log(stdout);
31       process.exit(err || !ok ? 1 : 0);
32     });
33   });
34 });