@@ -2,7 +2,6 @@ import { describe, expect, it } from "vite-plus/test";
22
33import {
44 isLoopbackHost ,
5- isPreviewableUrl ,
65 newPreviewTabId ,
76 normalizePreviewUrl ,
87 PreviewUrlNormalizationError ,
@@ -27,24 +26,6 @@ describe("isLoopbackHost", () => {
2726 } ) ;
2827} ) ;
2928
30- describe ( "isPreviewableUrl" , ( ) => {
31- it . each ( [
32- "http://localhost:5173" ,
33- "http://127.0.0.1:3000/path" ,
34- "http://0.0.0.0:8080" ,
35- "http://[::1]:5173" ,
36- ] ) ( "%s is previewable" , ( url ) => {
37- expect ( isPreviewableUrl ( url ) ) . toBe ( true ) ;
38- } ) ;
39-
40- it . each ( [ "https://example.com" , "ws://localhost:5173" , "file:///etc/passwd" , "not-a-url" , "" ] ) (
41- "%s is not previewable" ,
42- ( url ) => {
43- expect ( isPreviewableUrl ( url ) ) . toBe ( false ) ;
44- } ,
45- ) ;
46- } ) ;
47-
4829describe ( "normalizePreviewUrl" , ( ) => {
4930 it ( "treats bare loopback hosts as http" , ( ) => {
5031 expect ( normalizePreviewUrl ( "localhost:5173" ) ) . toBe ( "http://localhost:5173/" ) ;
0 commit comments