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

fix(jasmine): support "pending" it clauses with no test body #659

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@types/jasmine": "^2.2.33",
"@types/node": "^6.0.38",
"@types/systemjs": "^0.19.30",
"clang-format": "^1.0.46",
"clang-format": "1.0.46",
"concurrently": "^2.2.0",
"conventional-changelog": "^1.1.0",
"es6-promise": "^3.0.2",
Expand Down Expand Up @@ -79,7 +79,7 @@
"ts-loader": "^0.6.0",
"tslint": "^4.1.1",
"tslint-eslint-rules": "^3.1.0",
"typescript": "^2.0.2",
"typescript": "2.1.x",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to upgrade TS in a separate PR.

"vrsource-tslint-rules": "^4.0.0",
"whatwg-fetch": "^2.0.1"
}
Expand Down
3 changes: 2 additions & 1 deletion test/browser_entry_point.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ import './browser/requestAnimationFrame.spec';
import './browser/WebSocket.spec';
import './browser/XMLHttpRequest.spec';
import './browser/MediaQuery.spec';
import './mocha-patch.spec';
import './mocha-patch.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