This repository was archived by the owner on Feb 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -33,11 +33,8 @@ describe('setInterval', function () {
33
33
// This icky replacer is to deal with Timers in node.js. The data.handleId contains timers in
34
34
// node.js. They do not stringify properly since they contain circular references.
35
35
id = JSON . stringify ( ( < MacroTask > cancelId ) . data , function replaceTimer ( key , value ) {
36
- if ( value . _idleNext ) {
37
- return '' ;
38
- } else {
39
- return value ;
40
- }
36
+ if ( key == 'handleId' && typeof value == 'object' ) return value . constructor . name ;
37
+ return value ;
41
38
} ) ;
42
39
expect ( wtfMock . log ) . toEqual ( [
43
40
'# Zone:fork("<root>::WTF", "TestZone")' ,
Original file line number Diff line number Diff line change @@ -29,11 +29,8 @@ describe('setTimeout', function () {
29
29
// This icky replacer is to deal with Timers in node.js. The data.handleId contains timers in
30
30
// node.js. They do not stringify properly since they contain circular references.
31
31
id = JSON . stringify ( ( < MacroTask > cancelId ) . data , function replaceTimer ( key , value ) {
32
- if ( value . _idleNext ) {
33
- return '' ;
34
- } else {
35
- return value ;
36
- }
32
+ if ( key == 'handleId' && typeof value == 'object' ) return value . constructor . name ;
33
+ return value ;
37
34
} ) ;
38
35
expect ( wtfMock . log ) . toEqual ( [
39
36
'# Zone:fork("<root>::WTF", "TestZone")' ,
@@ -89,6 +86,8 @@ describe('setTimeout', function () {
89
86
} ) ;
90
87
91
88
it ( 'should return the timeout Id through toString' , function ( ) {
89
+ // Node returns complex object from setTimeout, ignore this test.
90
+ if ( isNode ) return ;
92
91
var cancelId = setTimeout ( ( ) => {
93
92
} , 0 ) ;
94
93
expect ( typeof ( cancelId . toString ( ) ) ) . toBe ( 'number' ) ;
You can’t perform that action at this time.
0 commit comments