File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -48,12 +48,17 @@ Deno.test("runtime.env", async () => {
4848 assertEquals ( env . BAZ , prefix . join ( "bar.com/v1.2.3/baz" ) . string )
4949} )
5050
51- Deno . test ( "missing() " , ( ) => {
51+ Deno . test ( "missing - without cache " , ( ) => {
5252 useTestConfig ( )
5353 usePantry ( ) . prefix . rm ( { recursive : true } )
5454 assert ( usePantry ( ) . missing ( ) )
5555} )
5656
57+ Deno . test ( "missing - with cache" , ( ) => {
58+ useTestConfig ( ) . cache . mkdir ( "p" ) . join ( 'pantry.db' ) . touch ( )
59+ usePantry ( ) . prefix . rm ( { recursive : true } )
60+ assert ( usePantry ( ) . missing ( ) )
61+ } )
5762
5863Deno . test ( "validatePackageRequirement - valid input" , ( ) => {
5964 const result = validatePackageRequirement ( "pkgx.sh/test" , "^1.0.0" )
Original file line number Diff line number Diff line change @@ -275,17 +275,11 @@ export default function usePantry() {
275275 function pantry_paths ( ) : Path [ ] {
276276 const rv : Path [ ] = [ ]
277277
278- if ( prefix . isDirectory ( ) ) {
279- rv . push ( prefix )
280- }
278+ rv . push ( prefix )
281279 for ( const path of useConfig ( ) . pantries . reverse ( ) ) {
282280 rv . unshift ( path . join ( "projects" ) )
283281 }
284282
285- if ( rv . length == 0 ) {
286- throw new PantryNotFoundError ( prefix )
287- }
288-
289283 return rv
290284 }
291285}
You can’t perform that action at this time.
0 commit comments