1- package pnpvfs_test
1+ package pnpvfs
22
33import (
44 "archive/zip"
@@ -10,7 +10,6 @@ import (
1010 "github.com/microsoft/typescript-go/internal/tspath"
1111 "github.com/microsoft/typescript-go/internal/vfs"
1212 "github.com/microsoft/typescript-go/internal/vfs/osvfs"
13- "github.com/microsoft/typescript-go/internal/vfs/pnpvfs"
1413 "github.com/microsoft/typescript-go/internal/vfs/vfstest"
1514 "gotest.tools/v3/assert"
1615)
@@ -35,10 +34,10 @@ func createTestZip(t *testing.T, files map[string]string) (string, vfs.FS) {
3534 assert .NilError (t , err )
3635 }
3736
38- fs := pnpvfs . From (osvfs .FS ())
37+ fs := From (osvfs .FS ())
3938
4039 t .Cleanup (func () {
41- errClear := fs .ClearCache ()
40+ errClear := fs .( * pnpFS ). ClearCache ()
4241 assert .NilError (t , errClear )
4342 })
4443
@@ -53,7 +52,7 @@ func TestPnpVfs_BasicFileOperations(t *testing.T) {
5352 "/project/package.json" : `{"name": "test"}` ,
5453 }, true )
5554
56- fs := pnpvfs . From (underlyingFS )
55+ fs := From (underlyingFS )
5756 assert .Assert (t , fs .FileExists ("/project/src/index.ts" ))
5857 assert .Assert (t , ! fs .FileExists ("/project/nonexistent.ts" ))
5958
@@ -106,7 +105,7 @@ func TestPnpVfs_ZipFileDetection(t *testing.T) {
106105func TestPnpVfs_ErrorHandling (t * testing.T ) {
107106 t .Parallel ()
108107
109- fs := pnpvfs . From (osvfs .FS ())
108+ fs := From (osvfs .FS ())
110109
111110 t .Run ("NonexistentZipFile" , func (t * testing.T ) {
112111 t .Parallel ()
@@ -147,9 +146,9 @@ func TestPnpVfs_ErrorHandling(t *testing.T) {
147146func TestPnpVfs_CaseSensitivity (t * testing.T ) {
148147 t .Parallel ()
149148
150- sensitiveFS := pnpvfs . From (vfstest .FromMap (map [string ]string {}, true ))
149+ sensitiveFS := From (vfstest .FromMap (map [string ]string {}, true ))
151150 assert .Assert (t , sensitiveFS .UseCaseSensitiveFileNames ())
152- insensitiveFS := pnpvfs . From (vfstest .FromMap (map [string ]string {}, false ))
151+ insensitiveFS := From (vfstest .FromMap (map [string ]string {}, false ))
153152 // pnpvfs is always case sensitive
154153 assert .Assert (t , insensitiveFS .UseCaseSensitiveFileNames ())
155154}
@@ -162,7 +161,7 @@ func TestPnpVfs_FallbackToRegularFiles(t *testing.T) {
162161 err := os .WriteFile (regularFile , []byte ("regular content" ), 0o644 )
163162 assert .NilError (t , err )
164163
165- fs := pnpvfs . From (osvfs .FS ())
164+ fs := From (osvfs .FS ())
166165
167166 assert .Assert (t , fs .FileExists (regularFile ))
168167
@@ -206,7 +205,7 @@ func TestPnpVfs_VirtualPathHandling(t *testing.T) {
206205 "/project/packages/packageB/package.json" : `{"name": "packageB"}` ,
207206 }, true )
208207
209- fs := pnpvfs . From (underlyingFS )
208+ fs := From (underlyingFS )
210209 assert .Assert (t , fs .FileExists ("/project/packages/__virtual__/packageA-virtual-123456/0/packageA/package.json" ))
211210 assert .Assert (t , fs .FileExists ("/project/packages/subfolder/__virtual__/packageA-virtual-123456/1/packageA/package.json" ))
212211
0 commit comments