New settings area: the webhook lives in the database and is only shown shortened afterwards, the environment variable stays as a fallback. A switch decides whether internal entries travel, a button sends the digest right away, and every run is recorded with period, count, projects, result and who triggered it.
19 lines
679 B
TypeScript
19 lines
679 B
TypeScript
import 'dotenv/config'
|
|
import { rmSync } from 'node:fs'
|
|
import { tmpdir } from 'node:os'
|
|
import { join } from 'node:path'
|
|
import { beforeEach } from 'vitest'
|
|
import { sql } from 'drizzle-orm'
|
|
import { db } from '~/data/db'
|
|
import { insertDefaultPostTypes } from './support/post-types'
|
|
|
|
const testStorage = join(tmpdir(), 'logbuch-test-storage')
|
|
|
|
rmSync(testStorage, { recursive: true, force: true })
|
|
process.env.STORAGE_DIR = testStorage
|
|
|
|
beforeEach(async () => {
|
|
await db.execute(sql`truncate table post_read, api_client, post_tag, tag, block, post, issue, media, project, brand, post_type, app_setting, report_run restart identity cascade`)
|
|
await insertDefaultPostTypes()
|
|
})
|