@@ -7,12 +7,17 @@ if (!common.hasCrypto) common.skip('missing crypto');
77
88const fixtures = require ( '../common/fixtures' ) ;
99const assert = require ( 'assert' ) ;
10- const { validateByRetainingPath } = require ( '../common/heap' ) ;
10+ const {
11+ createJSHeapSnapshot,
12+ validateByRetainingPathFromNodes,
13+ } = require ( '../common/heap' ) ;
1114const tls = require ( 'tls' ) ;
1215
1316{
14- const nodes = validateByRetainingPath ( 'Node / SecureContext' , [ ] ) ;
15- assert . strictEqual ( nodes . length , 0 ) ;
17+ const nodes = createJSHeapSnapshot ( ) ;
18+ const matches = nodes . filter (
19+ ( n ) => n . name === 'Node / SecureContext' && n . type !== 'string' ) ;
20+ assert . strictEqual ( matches . length , 0 ) ;
1621}
1722
1823// eslint-disable-next-line no-unused-vars
@@ -21,7 +26,12 @@ const ctx = tls.createSecureContext({
2126 key : fixtures . readKey ( 'agent1-key.pem' ) ,
2227} ) ;
2328
24- validateByRetainingPath ( 'Node / SecureContext' , [
25- { edge_name : 'ctx' , node_name : 'Node / ctx' } ,
26- { edge_name : 'cert' , node_name : 'Node / cert' } ,
27- ] ) ;
29+ {
30+ const nodes = createJSHeapSnapshot ( ) ;
31+ validateByRetainingPathFromNodes ( nodes , 'Node / SecureContext' , [
32+ { edge_name : 'ctx' , node_name : 'Node / ctx' } ,
33+ ] ) ;
34+ validateByRetainingPathFromNodes ( nodes , 'Node / SecureContext' , [
35+ { edge_name : 'cert' , node_name : 'Node / cert' } ,
36+ ] ) ;
37+ }
0 commit comments