From 6560865873291ae0e4daedeb4a17819f24d99c30 Mon Sep 17 00:00:00 2001 From: Tom Meagher Date: Sat, 28 Oct 2023 19:04:20 -0400 Subject: [PATCH] test: boost coverage --- src/config.test.ts | 20 ++++++++++++++++++++ src/utils/loadEnv.test.ts | 7 +++++++ 2 files changed, 27 insertions(+) create mode 100644 src/config.test.ts create mode 100644 src/utils/loadEnv.test.ts diff --git a/src/config.test.ts b/src/config.test.ts new file mode 100644 index 0000000..0184a50 --- /dev/null +++ b/src/config.test.ts @@ -0,0 +1,20 @@ +import { Kysely, MysqlDialect } from 'kysely' +import { createPool } from 'mysql2' +import { expect, test } from 'vitest' + +import { defineConfig } from './config.js' + +test('defineConfig', () => { + expect( + defineConfig({ + db: new Kysely({ + dialect: new MysqlDialect({ pool: createPool('mysql://') }), + }), + migrationFolder: 'src/db/migrations', + codegen: { + dialect: 'mysql', + out: 'src/db/types.ts', + }, + }), + ).toBeDefined() +}) diff --git a/src/utils/loadEnv.test.ts b/src/utils/loadEnv.test.ts new file mode 100644 index 0000000..216e1b5 --- /dev/null +++ b/src/utils/loadEnv.test.ts @@ -0,0 +1,7 @@ +import { expect, test } from 'vitest' + +import { loadEnv } from './loadEnv.js' + +test('loadEnv', () => { + expect(loadEnv()).toMatchInlineSnapshot('{}') +})