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

Commit

Permalink
fix(jasmine): support "pending" it clauses with no test body
Browse files Browse the repository at this point in the history
Closes #659
  • Loading branch information
petebacondarwin authored and mhevery committed Mar 7, 2017
1 parent bad4ad8 commit ddebedd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/jasmine/jasmine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@
// The `done` callback is only passed through if the function expects at least one argument.
// Note we have to make a function with correct number of arguments, otherwise jasmine will
// think that all functions are sync or async.
return (testBody.length == 0) ? function() {
return testProxyZone.run(testBody, this);
} : function(done) {
return testBody && (testBody.length ? function(done) {
return testProxyZone.run(testBody, this, [done]);
};
} : function() {
return testProxyZone.run(testBody, this);
});
}
interface QueueRunner {
execute(): void;
Expand Down
1 change: 1 addition & 0 deletions test/browser_entry_point.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ import './browser/XMLHttpRequest.spec';
import './browser/MediaQuery.spec';
import './mocha-patch.spec';
import './patch/indexedDB.spec';
import './jasmine-patch.spec';
2 changes: 2 additions & 0 deletions test/jasmine-patch.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ describe('jasmine', () => {
itZone = Zone.current;
});

it('should cope with pending tests, which have no test body');

afterEach(() => {
let zone = Zone.current;
expect(zone.name).toEqual('ProxyZone');
Expand Down

0 comments on commit ddebedd

Please sign in to comment.