Skip to content

Commit 8c7559e

Browse files
committed
update the jasmine-jstd-adapter with fixes
1 parent 11e1695 commit 8c7559e

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

test/lib/jasmine-jstd-adapter/JasmineAdapter.js

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*/
55
(function(window) {
66
var rootDescribes = new Describes(window);
7-
var describePath = [];
87
rootDescribes.collectMode();
98

109
var JASMINE_TYPE = 'jasmine test case';
@@ -22,7 +21,7 @@
2221
return false;
2322
},
2423

25-
runTestConfiguration: function(testRunConfiguration, onTestDone, onTestRunConfigurationComplete){
24+
runTestConfiguration: function(testRunConfiguration, onTestDone, onTestRunConfigurationComplete) {
2625
if (testRunConfiguration.getTestCaseInfo().getType() != JASMINE_TYPE) return false;
2726

2827
var jasmineEnv = jasmine.currentEnv_ = new jasmine.Env();
@@ -33,7 +32,7 @@
3332
return rootDescribes.isExclusive(spec);
3433
};
3534
jasmineEnv.reporter = {
36-
log: function(str){
35+
log: function(str) {
3736
specLog.push(str);
3837
},
3938

@@ -82,7 +81,7 @@
8281
return true;
8382
},
8483

85-
onTestsFinish: function(){
84+
onTestsFinish: function() {
8685
jasmine.currentEnv_ = null;
8786
rootDescribes.collectMode();
8887
}
@@ -92,16 +91,16 @@
9291
function formatStack(stack) {
9392
var lines = (stack||'').split(/\r?\n/);
9493
var frames = [];
95-
for (i = 0; i < lines.length; i++) {
94+
for (var i = 0; i < lines.length; i++) {
9695
if (!lines[i].match(/\/jasmine[\.-]/)) {
9796
frames.push(lines[i].replace(/https?:\/\/\w+(:\d+)?\/test\//, '').replace(/^\s*/, ' '));
9897
}
9998
}
10099
return frames.join('\n');
101100
}
102101

103-
function noop(){}
104-
function Describes(window){
102+
function noop() {}
103+
function Describes(window) {
105104
var describes = {};
106105
var beforeEachs = {};
107106
var afterEachs = {};
@@ -116,26 +115,26 @@
116115
intercept('beforeEach', beforeEachs);
117116
intercept('afterEach', afterEachs);
118117

119-
function intercept(functionName, collection){
120-
window[functionName] = function(desc, fn){
118+
function intercept(functionName, collection) {
119+
window[functionName] = function(desc, fn) {
121120
if (collectMode) {
122-
collection[desc] = function(){
121+
collection[desc] = function() {
123122
jasmine.getEnv()[functionName](desc, fn);
124123
};
125124
} else {
126125
jasmine.getEnv()[functionName](desc, fn);
127126
}
128127
};
129128
}
130-
window.ddescribe = function(name, fn){
129+
window.ddescribe = function(name, fn) {
131130
if (exclusive < 1) {
132131
exclusive = 1; // run ddescribe only
133132
}
134-
window.describe(name, function(){
133+
window.describe(name, function() {
135134
var oldIt = window.it;
136-
window.it = function(name, fn){
135+
window.it = function(name, fn) {
137136
fn.exclusive = 1; // run anything under ddescribe
138-
oldIt(name, fn);
137+
jasmine.getEnv().it(name, fn);
139138
};
140139
try {
141140
fn.call(this);
@@ -144,7 +143,7 @@
144143
};
145144
});
146145
};
147-
window.iit = function(name, fn){
146+
window.iit = function(name, fn) {
148147
exclusive = fn.exclusive = 2; // run only iits
149148
jasmine.getEnv().it(name, fn);
150149
};
@@ -154,7 +153,7 @@
154153
collectMode = true;
155154
exclusive = 0; // run everything
156155
};
157-
this.playback = function(){
156+
this.playback = function() {
158157
collectMode = false;
159158
playback(beforeEachs);
160159
playback(afterEachs);
@@ -195,4 +194,3 @@ jasmine.Spec.prototype.fail = function (e) {
195194
}
196195
this.results_.addResult(expectationResult);
197196
};
198-
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
da92db714142b49f9cf61db664e782bb0ccad80b @ 2011-10-18
1+
f6b1cf6cac90932c72c4349df8847e0ffd9acbc3 @ 2012-04-29

0 commit comments

Comments
 (0)