MCPcopy Index your code
hub / github.com/zenstackhq/zenstack / getTestDbName

Function getTestDbName

packages/testtools/src/client.ts:355–375  ·  view source on GitHub ↗
(provider: string)

Source from the content-addressed store, hash-verified

353}
354
355function getTestDbName(provider: string) {
356 if (provider === 'sqlite') {
357 return './test.db';
358 }
359 const testName = expect.getState().currentTestName ?? 'unnamed';
360 const testPath = expect.getState().testPath ?? '';
361 // digest test name
362 const digest = createHash('md5')
363 .update(testName + testPath)
364 .digest('hex');
365 // compute a database name based on test name
366 return (
367 'test_' +
368 testName
369 .toLowerCase()
370 .replace(/[^a-z0-9_]/g, '_')
371 .replace(/_+/g, '_')
372 .substring(0, 30) +
373 digest.slice(0, 6)
374 );
375}

Callers 1

createTestClientFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected