Skip to content

Commit c7ff437

Browse files
committed
feat: add bundle version
1 parent 2c30d99 commit c7ff437

1 file changed

Lines changed: 3 additions & 13 deletions

File tree

src/main.tsx

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,9 @@ import { RouterProvider } from "react-router";
55
import router from './AppRoutes';
66

77
if (import.meta.env.DEV) {
8-
// You choose how to load the tests; this example uses Vite's glob import
9-
const testModules = import.meta.glob("./**/*.twd.test.{ts,tsx}");
10-
const { initTests, twd, TWDSidebar } = await import('twd-js');
11-
// You need to pass the test modules, the sidebar component, and createRoot function
12-
initTests(testModules, <TWDSidebar open={true} position="left" />, createRoot);
13-
// if you want to use mock requests, you can initialize it here
14-
twd.initRequestMocking()
15-
.then(() => {
16-
console.log("Request mocking initialized");
17-
})
18-
.catch((err) => {
19-
console.error("Error initializing request mocking:", err);
20-
});
8+
const { initTWD } = await import('twd-js/bundled');
9+
const tests = import.meta.glob("./**/*.twd.test.ts")
10+
initTWD(tests);
2111
}
2212

2313
createRoot(document.getElementById('root')!).render(

0 commit comments

Comments
 (0)