Merge pull request #869 from ljwall/jasmine

Fixes #855
This commit is contained in:
Greg Chattin-McNichols and Gregg Van Hove
2015-08-03 14:58:33 -07:00
5 changed files with 135 additions and 15 deletions

View File

@@ -261,13 +261,17 @@ getJasmineRequireObj().Env = function(j$) {
this.describe = function(description, specDefinitions) {
var suite = suiteFactory(description);
if (currentDeclarationSuite.markedPending) {
suite.pend();
}
addSpecsToSuite(suite, specDefinitions);
return suite;
};
this.xdescribe = function(description, specDefinitions) {
var suite = this.describe(description, specDefinitions);
suite.disable();
var suite = suiteFactory(description);
suite.pend();
addSpecsToSuite(suite, specDefinitions);
return suite;
};
@@ -373,6 +377,9 @@ getJasmineRequireObj().Env = function(j$) {
this.it = function(description, fn, timeout) {
var spec = specFactory(description, fn, currentDeclarationSuite, timeout);
if (currentDeclarationSuite.markedPending) {
spec.pend();
}
currentDeclarationSuite.addChild(spec);
return spec;
};
@@ -383,9 +390,9 @@ getJasmineRequireObj().Env = function(j$) {
return spec;
};
this.fit = function(){
var spec = this.it.apply(this, arguments);
this.fit = function(description, fn, timeout){
var spec = specFactory(description, fn, currentDeclarationSuite, timeout);
currentDeclarationSuite.addChild(spec);
focusedRunnables.push(spec.id);
unfocusAncestor();
return spec;

View File

@@ -42,6 +42,10 @@ getJasmineRequireObj().Suite = function(j$) {
this.disabled = true;
};
Suite.prototype.pend = function(message) {
this.markedPending = true;
};
Suite.prototype.beforeEach = function(fn) {
this.beforeFns.unshift(fn);
};
@@ -67,6 +71,10 @@ getJasmineRequireObj().Suite = function(j$) {
return 'disabled';
}
if (this.markedPending) {
return 'pending';
}
if (this.result.failedExpectations.length > 0) {
return 'failed';
} else {