MCPcopy Index your code
hub / github.com/alan2207/bulletproof-react / initializeDb

Function initializeDb

apps/nextjs-app/src/testing/mocks/db.ts:88–98  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

86};
87
88export const initializeDb = async () => {
89 const database = await loadDb();
90 Object.entries(db).forEach(([key, model]) => {
91 const dataEntres = database[key];
92 if (dataEntres) {
93 dataEntres?.forEach((entry: Record<string, any>) => {
94 model.create(entry);
95 });
96 }
97 });
98};
99
100export const resetDb = () => {
101 window.localStorage.clear();

Callers 3

mock-server.tsFile · 0.90
setup-tests.tsFile · 0.90
enableMockingFunction · 0.70

Calls 1

loadDbFunction · 0.70

Tested by

no test coverage detected