fix hmr test errors
This commit is contained in:
@@ -82,7 +82,7 @@ setTimeout(() => {
|
|||||||
}, 0);
|
}, 0);
|
||||||
`)
|
`)
|
||||||
|
|
||||||
eps, err := loadVendorManifest(filepath.Join(frontendAbs, "vendor"))
|
eps, err := loadVendorManifest([]string{filepath.Join(frontendAbs, "vendor")})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("vendor manifest: %v", err)
|
t.Fatalf("vendor manifest: %v", err)
|
||||||
}
|
}
|
||||||
@@ -90,7 +90,7 @@ setTimeout(() => {
|
|||||||
hub: newHub(),
|
hub: newHub(),
|
||||||
frontend: frontendAbs,
|
frontend: frontendAbs,
|
||||||
srcRoot: tmpSrc,
|
srcRoot: tmpSrc,
|
||||||
vendor: filepath.Join(frontendAbs, "vendor"),
|
vendorDirs: []string{filepath.Join(frontendAbs, "vendor")},
|
||||||
graph: newModuleGraph(),
|
graph: newModuleGraph(),
|
||||||
vendorCache: map[string][]byte{},
|
vendorCache: map[string][]byte{},
|
||||||
cssTrigger: make(chan struct{}, 1),
|
cssTrigger: make(chan struct{}, 1),
|
||||||
|
|||||||
@@ -27,9 +27,9 @@ func TestDevServerAssetURL(t *testing.T) {
|
|||||||
[]byte(`import u from "pdfjs-dist/build/pdf.worker.min.mjs?url";
|
[]byte(`import u from "pdfjs-dist/build/pdf.worker.min.mjs?url";
|
||||||
export const url = u;`), 0o644)
|
export const url = u;`), 0o644)
|
||||||
|
|
||||||
eps, _ := loadVendorManifest(filepath.Join(frontendAbs, "vendor"))
|
eps, _ := loadVendorManifest([]string{filepath.Join(frontendAbs, "vendor")})
|
||||||
d := &devServer{hub: newHub(), frontend: frontendAbs, srcRoot: tmpSrc,
|
d := &devServer{hub: newHub(), frontend: frontendAbs, srcRoot: tmpSrc,
|
||||||
vendor: filepath.Join(frontendAbs, "vendor"), graph: newModuleGraph(),
|
vendorDirs: []string{filepath.Join(frontendAbs, "vendor")}, graph: newModuleGraph(),
|
||||||
vendorCache: map[string][]byte{}, cssTrigger: make(chan struct{}, 1), vendorEntrypoints: eps}
|
vendorCache: map[string][]byte{}, cssTrigger: make(chan struct{}, 1), vendorEntrypoints: eps}
|
||||||
|
|
||||||
out, err := d.transformModule(filepath.Join(tmpSrc, "uses-worker.tsx"))
|
out, err := d.transformModule(filepath.Join(tmpSrc, "uses-worker.tsx"))
|
||||||
|
|||||||
@@ -57,9 +57,9 @@ func TestServeModuleCompileErrorServesOverlay(t *testing.T) {
|
|||||||
os.WriteFile(filepath.Join(tmpSrc, "Broken.tsx"),
|
os.WriteFile(filepath.Join(tmpSrc, "Broken.tsx"),
|
||||||
[]byte("export default function Broken() {\n return <div><span></div>;\n}\n"), 0o644)
|
[]byte("export default function Broken() {\n return <div><span></div>;\n}\n"), 0o644)
|
||||||
|
|
||||||
eps, _ := loadVendorManifest(filepath.Join(frontendAbs, "vendor"))
|
eps, _ := loadVendorManifest([]string{filepath.Join(frontendAbs, "vendor")})
|
||||||
d := &devServer{hub: newHub(), frontend: frontendAbs, srcRoot: tmpSrc,
|
d := &devServer{hub: newHub(), frontend: frontendAbs, srcRoot: tmpSrc,
|
||||||
vendor: filepath.Join(frontendAbs, "vendor"), graph: newModuleGraph(),
|
vendorDirs: []string{filepath.Join(frontendAbs, "vendor")}, graph: newModuleGraph(),
|
||||||
vendorCache: map[string][]byte{}, cssTrigger: make(chan struct{}, 1), vendorEntrypoints: eps}
|
vendorCache: map[string][]byte{}, cssTrigger: make(chan struct{}, 1), vendorEntrypoints: eps}
|
||||||
|
|
||||||
req := httptest.NewRequest("GET", srcURLPrefix+"Broken.tsx", nil)
|
req := httptest.NewRequest("GET", srcURLPrefix+"Broken.tsx", nil)
|
||||||
|
|||||||
Reference in New Issue
Block a user