diff --git a/lib/jasmine/jasmine.ts b/lib/jasmine/jasmine.ts index 7e5183b19..9105cc114 100644 --- a/lib/jasmine/jasmine.ts +++ b/lib/jasmine/jasmine.ts @@ -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; diff --git a/package.json b/package.json index 68bfca1c4..c85b29606 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", "vrsource-tslint-rules": "^4.0.0", "whatwg-fetch": "^2.0.1" } diff --git a/test/browser_entry_point.ts b/test/browser_entry_point.ts index abf1b22f0..58de47da3 100644 --- a/test/browser_entry_point.ts +++ b/test/browser_entry_point.ts @@ -20,4 +20,5 @@ import './browser/requestAnimationFrame.spec'; import './browser/WebSocket.spec'; import './browser/XMLHttpRequest.spec'; import './browser/MediaQuery.spec'; -import './mocha-patch.spec'; \ No newline at end of file +import './mocha-patch.spec'; +import './jasmine-patch.spec'; \ No newline at end of file diff --git a/test/jasmine-patch.spec.ts b/test/jasmine-patch.spec.ts index 2dbb402fe..b46c44bb2 100644 --- a/test/jasmine-patch.spec.ts +++ b/test/jasmine-patch.spec.ts @@ -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');