-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.js
84 lines (65 loc) · 2.03 KB
/
index.js
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
'use strict';
// var Istanbul = require('istanbul')
// var instrumenter = new Istanbul.Instrumenter()
// // var changed = instrumenter.instrumentSync('function meaningOfLife() { return 42; }', 'filename.js');
// // console.log(changed)
// var IstanbulPreprocessor = require("./lib/istanbul-preprocessor")
var path = require("path")
var sup = {
name: "eci:hello",
run: function() {
console.log("hello from ember-cli-istanbul")
}
};
var runCoverage = {
name: "istanbul:coverage-server",
run: function() {
// var file = "./lib/coverage_server";
// var fullFile = path.resolve(file);
// console.log("node " + fullFile + ".js")
// require(file)
//console.log("running")
var root = path.resolve(".")
var file = root + "/node_modules/ember-cli-istanbul/lib/coverage_server.js"
console.log("Run this: node " + file)
}
};
// var shellTest = {
// name: "shell-test",
// run: function() {
// var sys = require('sys')
// var exec = require('child_process').exec;
// function puts(error, stdout, stderr) { sys.puts(stdout) }
// exec("ls -la", puts);
// }
// }
// function EmberCliIstanbul(proj) {
// this.name = "ember-cli-istanbul";
// this.appName = proj.name();
// }
// EmberCliIstanbul.prototype.included = function(app) {
// console.log("in eci included");
// var beforeFunc = require("./lib/istanbul-concat-filter");
// app.options.beforeOutputPushFunc = beforeFunc(app.name);
// }
// module.exports = EmberCliIstanbul
module.exports = {
name: "ember-cli-istanbul",
// included: function(app) {
// //console.log("included");
// this.app = app;
// var plugin = new IstanbulPreprocessor({});
// this.app.registry.add('js', plugin);
// },
included: function(app) {
console.log("in eci included");
var beforeFunc = require("./lib/istanbul-concat-filter");
app.options.beforeOutputPushFunc = beforeFunc(app.name);
},
includedCommands: function() {
return [sup,runCoverage]
}
// sayHello: function() {
// console.log("hello");
// }
}