Skip to content

Commit

Permalink
fallback to import url: for jest compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
cerisier committed Jan 13, 2025
1 parent ff9c63f commit 5f70af5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions sample/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module '*.txt';
5 changes: 1 addition & 4 deletions src/views/application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ async function importFromFileSystemDirectoryEntry(entry: FileSystemDirectoryEntr
return (await importModule).importFromFileSystemDirectoryEntry(entry)
}

const exampleProfileURL = new URL(
'../../sample/profiles/stackcollapse/perf-vertx-stacks-01-collapsed-all.txt',
import.meta.url,
)
import exampleProfileURL from "url:../../sample/profiles/stackcollapse/perf-vertx-stacks-01-collapsed-all.txt";

function isFileSystemDirectoryEntry(entry: FileSystemEntry): entry is FileSystemDirectoryEntry {
return entry != null && entry.isDirectory
Expand Down

0 comments on commit 5f70af5

Please sign in to comment.