29 lines
599 B
TypeScript
29 lines
599 B
TypeScript
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||
|
import { initDb } from '.';
|
||
|
|
||
|
import { putRtept } from './rtept';
|
||
|
|
||
|
const test = it;
|
||
|
const jest = vi;
|
||
|
|
||
|
declare global {
|
||
|
var db: any;
|
||
|
var dbReady: boolean;
|
||
|
}
|
||
|
|
||
|
const originalDb = globalThis.db;
|
||
|
const originalDateNow = globalThis.Date.now;
|
||
|
|
||
|
describe('The rtept module with a real db', () => {
|
||
|
beforeEach(async () => {
|
||
|
await initDb({});
|
||
|
globalThis.Date.now = () => 0;
|
||
|
});
|
||
|
afterEach(async () => {
|
||
|
await db.destroy();
|
||
|
db = undefined;
|
||
|
globalThis.Date.now = originalDateNow;
|
||
|
});
|
||
|
it('', () => {});
|
||
|
});
|