Skip to content

Commit

Permalink
✅ Fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaoz-Topsy committed Jun 19, 2024
1 parent 3dae754 commit 47b6055
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/api/misc/misc.test.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import 'reflect-metadata';
import { test, describe, expect, vi } from 'vitest';
import { describe, expect, test, vi } from 'vitest';

import { defaultEndpoint, versionEndpoint } from './misc';
import { apiParams, ApiStatusErrorCode } from '@constants/api';
import { fakePromise } from '@helpers/typescriptHacks';
import { defaultEndpoint, versionEndpoint } from './misc';

describe('Misc endpoints', () => {
test('default endpoint returns 200 OK', async () => {
const ctx: any = {
response: {},
redirect: () => {},
};
const next = vi.fn().mockResolvedValue(fakePromise());
await defaultEndpoint(ctx, next);
expect(ctx.response.status).toBe(200);
expect(ctx.response.status).toBe(303);
});
test('version endpoint with correct authToken', async () => {
const authToken = 'testertest';
Expand Down

0 comments on commit 47b6055

Please sign in to comment.