feat: Introduce backend test suite with ava
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
import { URL } from 'node:url';
|
||||
import * as dotenv from 'dotenv';
|
||||
dotenv.config();
|
||||
import path from 'path';
|
||||
|
||||
if (process.env.APP_ENV === 'test') {
|
||||
dotenv.config({ path: path.resolve(__dirname, '../../.env.test') });
|
||||
} else {
|
||||
dotenv.config();
|
||||
}
|
||||
|
||||
type AppConfig = {
|
||||
host: string;
|
||||
|
8
packages/backend/src/graphql/queries/get-user.test.ts
Normal file
8
packages/backend/src/graphql/queries/get-user.test.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import test from 'ava';
|
||||
|
||||
const fn = () => 'foo';
|
||||
|
||||
test('getUser graphQL query', (t) => {
|
||||
// TODO: Write a test for getUser graphQL query
|
||||
t.is(fn(), 'foo');
|
||||
});
|
Reference in New Issue
Block a user