aboutsummaryrefslogtreecommitdiffstats
path: root/docs/spec/specs.js
blob: 1b267ab341f82d4257cf81cd0def3a08dc891fa5 (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
if (global.jasmine) return;

var jasmine = require('../../lib/jasmine-1.0.1');

for(var key in jasmine) {
  global[key] = jasmine[key];
}

//Patch Jasmine for proper stack traces
jasmine.Spec.prototype.fail = function(e) {
  var expectationResult = new jasmine.ExpectationResult({
    passed: false,
    message: e ? jasmine.util.formatException(e) : 'Exception'
  });
  // PATCH
  if (e) {
   expectationResult.trace = e;
  }
  this.results_.addResult(expectationResult);
};



var isVerbose = false;
var showColors = true;
process.argv.forEach(function(arg){
  switch(arg) {
  case '--color': showColors = true; break;
  case '--noColor': showColors = false; break;
  case '--verbose': isVerbose = true; break;
  }
});

jasmine.executeSpecsInFolder(__dirname, function(runner, log){
  process.exit(runner.results().failedCount);
}, isVerbose, showColors);