@@ -277,6 +277,87 @@ describe('DenoWorker', () => {
277277 } ) ;
278278 } ) ;
279279
280+ describe ( 'denoNoCheck' , async ( ) => {
281+ afterEach ( ( ) => {
282+ jest . clearAllMocks ( ) ;
283+ } ) ;
284+
285+ it ( 'should not include the --no-check flag by default' , async ( ) => {
286+ const spawnSpy = jest . spyOn ( child_process , 'spawn' ) ;
287+
288+ worker = new DenoWorker ( echoScript ) ;
289+
290+ let resolve : any ;
291+ let promise = new Promise ( ( res , rej ) => {
292+ resolve = res ;
293+ } ) ;
294+ worker . onmessage = ( e ) => {
295+ resolve ( ) ;
296+ } ;
297+
298+ worker . postMessage ( {
299+ type : 'echo' ,
300+ message : 'Hello' ,
301+ } ) ;
302+
303+ await promise ;
304+
305+ const call = spawnSpy . mock . calls [ 0 ] ;
306+ const [ _deno , args ] = call ;
307+ expect ( args ) . not . toContain ( '--no-check' ) ;
308+ } ) ;
309+
310+ it ( 'should not include the --no-check flag by when denoNoCheck is false' , async ( ) => {
311+ const spawnSpy = jest . spyOn ( child_process , 'spawn' ) ;
312+
313+ worker = new DenoWorker ( echoScript , { denoNoCheck : false } ) ;
314+
315+ let resolve : any ;
316+ let promise = new Promise ( ( res , rej ) => {
317+ resolve = res ;
318+ } ) ;
319+ worker . onmessage = ( e ) => {
320+ resolve ( ) ;
321+ } ;
322+
323+ worker . postMessage ( {
324+ type : 'echo' ,
325+ message : 'Hello' ,
326+ } ) ;
327+
328+ await promise ;
329+
330+ const call = spawnSpy . mock . calls [ 0 ] ;
331+ const [ _deno , args ] = call ;
332+ expect ( args ) . not . toContain ( '--no-check' ) ;
333+ } ) ;
334+
335+ it ( 'should include the --no-check flag when denoNoCheck is true' , async ( ) => {
336+ const spawnSpy = jest . spyOn ( child_process , 'spawn' ) ;
337+
338+ worker = new DenoWorker ( echoScript , { denoNoCheck : true } ) ;
339+
340+ let resolve : any ;
341+ let promise = new Promise ( ( res , rej ) => {
342+ resolve = res ;
343+ } ) ;
344+ worker . onmessage = ( e ) => {
345+ resolve ( ) ;
346+ } ;
347+
348+ worker . postMessage ( {
349+ type : 'echo' ,
350+ message : 'Hello' ,
351+ } ) ;
352+
353+ await promise ;
354+
355+ const call = spawnSpy . mock . calls [ 0 ] ;
356+ const [ _deno , args ] = call ;
357+ expect ( args ) . toContain ( '--no-check' ) ;
358+ } ) ;
359+ } ) ;
360+
280361 describe ( 'denoImportMapPath' , async ( ) => {
281362 afterEach ( ( ) => {
282363 jest . clearAllMocks ( ) ;
0 commit comments