@@ -499,6 +499,44 @@ describe("publish", () => {
499
499
} ) ;
500
500
} ) . timeout ( 600000 ) ;
501
501
502
+ it ( "should leave node_modules as is" , async ( ) => {
503
+ await runInTempDir ( async ( dir ) => {
504
+ const pkgJsonPath = path . join ( dir , "package.json" ) ;
505
+ const pkgJson = await readJson < PkgJson > ( pkgJsonPath ) ;
506
+ pkgJson . exports = {
507
+ "." : "./mod.js" ,
508
+ } ;
509
+ await writeJson ( pkgJsonPath , pkgJson ) ;
510
+
511
+ // Add dependency
512
+ await runJsr ( [ "i" , "--npm" , "@std/encoding@0.216.0" ] , dir ) ;
513
+
514
+ await writeTextFile (
515
+ path . join ( dir , "mod.ts" ) ,
516
+ [
517
+ 'import * as encoding from "@std/encoding/hex";' ,
518
+ "console.log(encoding);" ,
519
+ "export const value = 42;" ,
520
+ ] . join ( "\n" ) ,
521
+ ) ;
522
+
523
+ await writeJson < DenoJson > ( path . join ( dir , "jsr.json" ) , {
524
+ name : "@deno/jsr-cli-test" ,
525
+ version : pkgJson . version ! ,
526
+ exports : {
527
+ "." : "./mod.ts" ,
528
+ } ,
529
+ } ) ;
530
+
531
+ await runJsr ( [ "publish" , "--dry-run" , "--token" , "dummy-token" ] , dir ) ;
532
+
533
+ assert . ok (
534
+ ! ( await isDirectory ( path . join ( dir , "node_modules" , ".deno" ) ) ) ,
535
+ ".deno found inside node_modules" ,
536
+ ) ;
537
+ } ) ;
538
+ } ) ;
539
+
502
540
// Windows doesn't support #!/usr/bin/env
503
541
if ( process . platform !== "win32" ) {
504
542
it ( "use deno binary from DENO_BIN_PATH when set" , async ( ) => {
0 commit comments