File tree Expand file tree Collapse file tree 7 files changed +58
-2
lines changed Expand file tree Collapse file tree 7 files changed +58
-2
lines changed Original file line number Diff line number Diff line change 1+ ! deno.lock
Original file line number Diff line number Diff line change 1+ {
2+ "workspace" : []
3+ }
Original file line number Diff line number Diff line change 1+ import isOdd from "npm:is-odd@^3" ;
2+ import json from "npm:is-odd@^3/package.json" with { type : "json" } ;
3+
4+ console . log ( isOdd ) ;
5+
6+ Deno . serve ( ( ) => new Response ( json [ "version" ] ) ) ;
Original file line number Diff line number Diff line change @@ -4224,6 +4224,27 @@ async fn test_user_worker_with_import_map() {
42244224 }
42254225}
42264226
4227+ #[ tokio:: test]
4228+ #[ serial]
4229+ async fn test_pin_package_version_correctly ( ) {
4230+ integration_test ! (
4231+ "./test_cases/pin-package" ,
4232+ NON_SECURE_PORT ,
4233+ "" ,
4234+ None ,
4235+ None ,
4236+ None ,
4237+ ( |resp| async {
4238+ let res = resp. unwrap( ) ;
4239+ assert!( res. status( ) . as_u16( ) == 200 ) ;
4240+
4241+ let body_bytes = res. bytes( ) . await . unwrap( ) ;
4242+ assert_eq!( body_bytes, r#"3.0.0"# ) ;
4243+ } ) ,
4244+ TerminationToken :: new( )
4245+ ) ;
4246+ }
4247+
42274248#[ derive( Deserialize ) ]
42284249struct ErrorResponsePayload {
42294250 msg : String ,
Original file line number Diff line number Diff line change @@ -356,7 +356,15 @@ impl EmitterFactory {
356356 } else {
357357 CliNpmResolverCreateOptions :: Managed (
358358 CliManagedNpmResolverCreateOptions {
359- snapshot : CliNpmResolverManagedSnapshotOption :: Specified ( None ) ,
359+ snapshot : if let Some ( lockfile) =
360+ options. maybe_lockfile ( ) . cloned ( )
361+ {
362+ CliNpmResolverManagedSnapshotOption :: ResolveFromLockfile (
363+ lockfile,
364+ )
365+ } else {
366+ CliNpmResolverManagedSnapshotOption :: Specified ( None )
367+ } ,
360368 maybe_lockfile : options. maybe_lockfile ( ) . cloned ( ) ,
361369 fs,
362370 http_client_provider : self . http_client_provider ( ) . clone ( ) ,
Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ async fn resolve_snapshot(
179179 let guard = lockfile. lock ( ) ;
180180 ( guard. overwrite , guard. filename . clone ( ) )
181181 } ;
182- if overwrite {
182+ if ! overwrite {
183183 let snapshot = snapshot_from_lockfile (
184184 lockfile. clone ( ) ,
185185 & registry_info_provider. as_npm_registry_api ( ) ,
You can’t perform that action at this time.
0 commit comments