From 0bbe58e6085597b7b7d55195eac44f9f9b0e182a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Tesa=C5=99?= Date: Mon, 25 Sep 2023 11:41:55 +0200 Subject: [PATCH] Fix tests --- .github/workflows/main.yml | 6 +++--- packages/api/src/utils.ts | 2 +- packages/data-pusher/src/validation/schema.test.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e332d6b1..0edcdd00 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,7 +19,7 @@ jobs: lint-build-test: runs-on: ubuntu-latest - name: Lint, build and test + name: Build, lint and test steps: - name: Clone repo uses: actions/checkout@v4 @@ -34,10 +34,10 @@ jobs: cache: 'pnpm' - name: Install Dependencies run: pnpm install --frozen-lockfile - - name: Lint - run: pnpm run prettier:check && pnpm run eslint:check - name: Build run: pnpm run build + - name: Lint + run: pnpm run prettier:check && pnpm run eslint:check - name: Test run: pnpm run test diff --git a/packages/api/src/utils.ts b/packages/api/src/utils.ts index 36c351f5..0b6c5703 100644 --- a/packages/api/src/utils.ts +++ b/packages/api/src/utils.ts @@ -21,4 +21,4 @@ export const generateErrorResponse = ( }; export const getConfig = () => - configSchema.parse(JSON.parse(readFileSync(join(__dirname, '../config/signed-api.json'), 'utf8'))); + configSchema.parse(JSON.parse(readFileSync(join(__dirname, '../config/signed-api.example.json'), 'utf8'))); diff --git a/packages/data-pusher/src/validation/schema.test.ts b/packages/data-pusher/src/validation/schema.test.ts index e3334864..9608afb7 100644 --- a/packages/data-pusher/src/validation/schema.test.ts +++ b/packages/data-pusher/src/validation/schema.test.ts @@ -2,8 +2,8 @@ import { readFileSync } from 'fs'; import { join } from 'path'; import { configSchema } from './schema'; -it('validates example config', () => { +it('validates example config', async () => { const config = JSON.parse(readFileSync(join(__dirname, '../../config/pusher.example.json'), 'utf8')); - expect(() => configSchema.parse(config)).not.toThrow(); + await expect(configSchema.parseAsync(config)).resolves.not.toThrow(); });