@@ -128,8 +128,8 @@ describe("Instance.containsPath", () => {
128128 await Instance . provide ( {
129129 directory : tmp . path ,
130130 fn : ( ) => {
131- expect ( Instance . containsPath ( path . join ( tmp . path , "foo.txt" ) ) ) . toBe ( true )
132- expect ( Instance . containsPath ( path . join ( tmp . path , "src" , "file.ts" ) ) ) . toBe ( true )
131+ expect ( Instance . containsPath ( path . join ( tmp . path , "foo.txt" ) , Instance . current ) ) . toBe ( true )
132+ expect ( Instance . containsPath ( path . join ( tmp . path , "src" , "file.ts" ) , Instance . current ) ) . toBe ( true )
133133 } ,
134134 } )
135135 } )
@@ -143,11 +143,11 @@ describe("Instance.containsPath", () => {
143143 directory : subdir ,
144144 fn : ( ) => {
145145 // .opencode at worktree root, but we're running from packages/lib
146- expect ( Instance . containsPath ( path . join ( tmp . path , ".opencode" , "state" ) ) ) . toBe ( true )
146+ expect ( Instance . containsPath ( path . join ( tmp . path , ".opencode" , "state" ) , Instance . current ) ) . toBe ( true )
147147 // sibling package should also be accessible
148- expect ( Instance . containsPath ( path . join ( tmp . path , "packages" , "other" , "file.ts" ) ) ) . toBe ( true )
148+ expect ( Instance . containsPath ( path . join ( tmp . path , "packages" , "other" , "file.ts" ) , Instance . current ) ) . toBe ( true )
149149 // worktree root itself
150- expect ( Instance . containsPath ( tmp . path ) ) . toBe ( true )
150+ expect ( Instance . containsPath ( tmp . path , Instance . current ) ) . toBe ( true )
151151 } ,
152152 } )
153153 } )
@@ -158,8 +158,8 @@ describe("Instance.containsPath", () => {
158158 await Instance . provide ( {
159159 directory : tmp . path ,
160160 fn : ( ) => {
161- expect ( Instance . containsPath ( "/etc/passwd" ) ) . toBe ( false )
162- expect ( Instance . containsPath ( "/tmp/other-project" ) ) . toBe ( false )
161+ expect ( Instance . containsPath ( "/etc/passwd" , Instance . current ) ) . toBe ( false )
162+ expect ( Instance . containsPath ( "/tmp/other-project" , Instance . current ) ) . toBe ( false )
163163 } ,
164164 } )
165165 } )
@@ -170,7 +170,7 @@ describe("Instance.containsPath", () => {
170170 await Instance . provide ( {
171171 directory : tmp . path ,
172172 fn : ( ) => {
173- expect ( Instance . containsPath ( path . join ( tmp . path , ".." , "escape.txt" ) ) ) . toBe ( false )
173+ expect ( Instance . containsPath ( path . join ( tmp . path , ".." , "escape.txt" ) , Instance . current ) ) . toBe ( false )
174174 } ,
175175 } )
176176 } )
@@ -182,8 +182,8 @@ describe("Instance.containsPath", () => {
182182 directory : tmp . path ,
183183 fn : ( ) => {
184184 expect ( Instance . directory ) . toBe ( Instance . worktree )
185- expect ( Instance . containsPath ( path . join ( tmp . path , "file.txt" ) ) ) . toBe ( true )
186- expect ( Instance . containsPath ( "/etc/passwd" ) ) . toBe ( false )
185+ expect ( Instance . containsPath ( path . join ( tmp . path , "file.txt" ) , Instance . current ) ) . toBe ( true )
186+ expect ( Instance . containsPath ( "/etc/passwd" , Instance . current ) ) . toBe ( false )
187187 } ,
188188 } )
189189 } )
@@ -195,9 +195,9 @@ describe("Instance.containsPath", () => {
195195 directory : tmp . path ,
196196 fn : ( ) => {
197197 // worktree is "/" for non-git projects, but containsPath should NOT allow all paths
198- expect ( Instance . containsPath ( path . join ( tmp . path , "file.txt" ) ) ) . toBe ( true )
199- expect ( Instance . containsPath ( "/etc/passwd" ) ) . toBe ( false )
200- expect ( Instance . containsPath ( "/tmp/other" ) ) . toBe ( false )
198+ expect ( Instance . containsPath ( path . join ( tmp . path , "file.txt" ) , Instance . current ) ) . toBe ( true )
199+ expect ( Instance . containsPath ( "/etc/passwd" , Instance . current ) ) . toBe ( false )
200+ expect ( Instance . containsPath ( "/tmp/other" , Instance . current ) ) . toBe ( false )
201201 } ,
202202 } )
203203 } )
0 commit comments