Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit ddebedd

Browse files
petebacondarwinmhevery
authored andcommitted
fix(jasmine): support "pending" it clauses with no test body
Closes #659
1 parent bad4ad8 commit ddebedd

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

lib/jasmine/jasmine.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@
8989
// The `done` callback is only passed through if the function expects at least one argument.
9090
// Note we have to make a function with correct number of arguments, otherwise jasmine will
9191
// think that all functions are sync or async.
92-
return (testBody.length == 0) ? function() {
93-
return testProxyZone.run(testBody, this);
94-
} : function(done) {
92+
return testBody && (testBody.length ? function(done) {
9593
return testProxyZone.run(testBody, this, [done]);
96-
};
94+
} : function() {
95+
return testProxyZone.run(testBody, this);
96+
});
9797
}
9898
interface QueueRunner {
9999
execute(): void;

test/browser_entry_point.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ import './browser/XMLHttpRequest.spec';
2222
import './browser/MediaQuery.spec';
2323
import './mocha-patch.spec';
2424
import './patch/indexedDB.spec';
25+
import './jasmine-patch.spec';

test/jasmine-patch.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ describe('jasmine', () => {
3030
itZone = Zone.current;
3131
});
3232

33+
it('should cope with pending tests, which have no test body');
34+
3335
afterEach(() => {
3436
let zone = Zone.current;
3537
expect(zone.name).toEqual('ProxyZone');

0 commit comments

Comments
 (0)