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

Commit

Permalink
fix(build): fix broken master due to setTimeout not returning a numbe…
Browse files Browse the repository at this point in the history
…r on node
  • Loading branch information
mhevery committed Aug 15, 2016
1 parent dbcfb32 commit d43b4b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
7 changes: 2 additions & 5 deletions test/common/setInterval.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,8 @@ describe('setInterval', function () {
// This icky replacer is to deal with Timers in node.js. The data.handleId contains timers in
// node.js. They do not stringify properly since they contain circular references.
id = JSON.stringify((<MacroTask>cancelId).data, function replaceTimer(key, value) {
if (value._idleNext) {
return '';
} else {
return value;
}
if (key == 'handleId' && typeof value == 'object') return value.constructor.name;
return value;
});
expect(wtfMock.log).toEqual([
'# Zone:fork("<root>::WTF", "TestZone")',
Expand Down
9 changes: 4 additions & 5 deletions test/common/setTimeout.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@ describe('setTimeout', function () {
// This icky replacer is to deal with Timers in node.js. The data.handleId contains timers in
// node.js. They do not stringify properly since they contain circular references.
id = JSON.stringify((<MacroTask>cancelId).data, function replaceTimer(key, value) {
if (value._idleNext) {
return '';
} else {
return value;
}
if (key == 'handleId' && typeof value == 'object') return value.constructor.name;
return value;
});
expect(wtfMock.log).toEqual([
'# Zone:fork("<root>::WTF", "TestZone")',
Expand Down Expand Up @@ -89,6 +86,8 @@ describe('setTimeout', function () {
});

it('should return the timeout Id through toString', function () {
// Node returns complex object from setTimeout, ignore this test.
if (isNode) return;
var cancelId = setTimeout(() => {
}, 0);
expect(typeof (cancelId.toString())).toBe('number');
Expand Down

0 comments on commit d43b4b8

Please sign in to comment.