@@ -9,10 +9,9 @@ vi.mock('./fetch-purl-deep-score.mts', () => ({
99vi . mock ( './output-purls-deep-score.mts' , ( ) => ( {
1010 outputPurlsDeepScore : vi . fn ( ) ,
1111} ) )
12- vi . mock ( '../../utils/debug.mts' , ( ) => ( {
12+ vi . mock ( '@socketsecurity/lib/debug' , ( ) => ( {
13+ debug : vi . fn ( ) ,
1314 debugDir : vi . fn ( ) ,
14- debugFn : vi . fn ( ) ,
15- debugLog : vi . fn ( ) ,
1615 isDebug : vi . fn ( ( ) => false ) ,
1716} ) )
1817
@@ -23,7 +22,7 @@ describe('handlePurlDeepScore', () => {
2322
2423 it ( 'fetches and outputs deep score successfully' , async ( ) => {
2524 const { fetchPurlDeepScore } = await import ( './fetch-purl-deep-score.mts' )
26- const { outputPurlsDeepScore : _outputPurlsDeepScore } = await import (
25+ const { outputPurlsDeepScore } = await import (
2726 './output-purls-deep-score.mts'
2827 )
2928
@@ -47,7 +46,7 @@ describe('handlePurlDeepScore', () => {
4746
4847 it ( 'handles fetch failure' , async ( ) => {
4948 const { fetchPurlDeepScore } = await import ( './fetch-purl-deep-score.mts' )
50- const { outputPurlsDeepScore : _outputPurlsDeepScore } = await import (
49+ const { outputPurlsDeepScore } = await import (
5150 './output-purls-deep-score.mts'
5251 )
5352
@@ -66,7 +65,7 @@ describe('handlePurlDeepScore', () => {
6665
6766 it ( 'handles markdown output' , async ( ) => {
6867 const { fetchPurlDeepScore } = await import ( './fetch-purl-deep-score.mts' )
69- const { outputPurlsDeepScore : _outputPurlsDeepScore } = await import (
68+ const { outputPurlsDeepScore } = await import (
7069 './output-purls-deep-score.mts'
7170 )
7271
@@ -91,7 +90,7 @@ describe('handlePurlDeepScore', () => {
9190 } )
9291
9392 it ( 'logs debug information' , async ( ) => {
94- const { debugDir , debugFn } = await import ( '../../utils/ debug.mts ' )
93+ const { debug , debugDir } = await import ( '@socketsecurity/lib/ debug' )
9594 const { fetchPurlDeepScore } = await import ( './fetch-purl-deep-score.mts' )
9695
9796 const mockData = {
@@ -103,23 +102,19 @@ describe('handlePurlDeepScore', () => {
103102 const purl = 'pkg:npm/package1@1.0.0'
104103 await handlePurlDeepScore ( purl , 'json' )
105104
106- expect ( debugFn ) . toHaveBeenCalledWith (
107- 'notice' ,
105+ expect ( debug ) . toHaveBeenCalledWith (
108106 'Fetching deep score for pkg:npm/package1@1.0.0' ,
109107 )
110- expect ( debugDir ) . toHaveBeenCalledWith ( 'inspect' , {
108+ expect ( debugDir ) . toHaveBeenCalledWith ( {
111109 purl,
112110 outputKind : 'json' ,
113111 } )
114- expect ( debugFn ) . toHaveBeenCalledWith (
115- 'notice' ,
116- 'Deep score fetched successfully' ,
117- )
118- expect ( debugDir ) . toHaveBeenCalledWith ( 'inspect' , { result : mockData } )
112+ expect ( debug ) . toHaveBeenCalledWith ( 'Deep score fetched successfully' )
113+ expect ( debugDir ) . toHaveBeenCalledWith ( { result : mockData } )
119114 } )
120115
121116 it ( 'logs debug information on failure' , async ( ) => {
122- const { debugFn } = await import ( '../../utils/ debug.mts ' )
117+ const { debug } = await import ( '@socketsecurity/lib/ debug' )
123118 const { fetchPurlDeepScore } = await import ( './fetch-purl-deep-score.mts' )
124119
125120 const mockError = {
@@ -130,12 +125,12 @@ describe('handlePurlDeepScore', () => {
130125
131126 await handlePurlDeepScore ( 'pkg:npm/package1@1.0.0' , 'json' )
132127
133- expect ( debugFn ) . toHaveBeenCalledWith ( 'notice' , 'Deep score fetch failed' )
128+ expect ( debug ) . toHaveBeenCalledWith ( 'Deep score fetch failed' )
134129 } )
135130
136131 it ( 'handles different purl formats' , async ( ) => {
137132 const { fetchPurlDeepScore } = await import ( './fetch-purl-deep-score.mts' )
138- const { outputPurlsDeepScore : _outputPurlsDeepScore } = await import (
133+ const { outputPurlsDeepScore } = await import (
139134 './output-purls-deep-score.mts'
140135 )
141136
@@ -160,7 +155,7 @@ describe('handlePurlDeepScore', () => {
160155
161156 it ( 'handles text output' , async ( ) => {
162157 const { fetchPurlDeepScore } = await import ( './fetch-purl-deep-score.mts' )
163- const { outputPurlsDeepScore : _outputPurlsDeepScore } = await import (
158+ const { outputPurlsDeepScore } = await import (
164159 './output-purls-deep-score.mts'
165160 )
166161
0 commit comments