@t1mmen/srtd
Version:
Supabase Repeatable Template Definitions (srtd): ๐ช Live-reloading SQL templates for Supabase DX. Make your database changes reviewable and migrations maintainable! ๐
28 lines (27 loc) โข 1.01 kB
TypeScript
interface TestContext {
timestamp: number;
testDir: string;
testFunctionName: string;
templateCounter: number;
}
/**
* Creates a test context with all the goodies we need! ๐
*/
export declare function createTestContext(name?: string): TestContext;
/**
* Get unique template names - perfect for testing! ๐ท๏ธ
*/
export declare function getNextTemplateName(context: TestContext, prefix?: string): string;
/**
* Create a template file with whatever content you want! ๐
*/
export declare function createTemplate(context: TestContext, name: string, content: string, dir?: string): Promise<string>;
/**
* Create a template with a basic Postgres function - the bread and butter of testing! ๐
*/
export declare function createTemplateWithFunc(context: TestContext, prefix: string, funcSuffix?: string, dir?: string): Promise<string>;
/**
* Clean up after our tests like good citizens! ๐งน
*/
export declare function cleanupTestContext(context: TestContext): Promise<void>;
export {};