Skip to content

Commit

Permalink
test: fix for vitest upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Dec 11, 2023
1 parent f0b8d56 commit 8e27503
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ jobs:
path: ./packages/frontend/native

- name: Unit Test
run: yarn nx test:coverage @affine/monorepo
run: yarn workspace @affine/monorepo test:coverage

- name: Upload unit test coverage results
uses: codecov/codecov-action@v3
Expand Down
9 changes: 5 additions & 4 deletions packages/frontend/electron/test/db/migration.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import path from 'node:path';

import {
copyToTemp,
migrateToSubdocAndReplaceDatabase,
} from '@affine/electron/helper/db/migration';
import { SqliteConnection } from '@affine/native';
import { removeWithRetry } from '@affine-test/kit/utils/utils';
import { afterEach, describe, expect, it, vi } from 'vitest';
import { applyUpdate, Doc as YDoc } from 'yjs';

import {
copyToTemp,
migrateToSubdocAndReplaceDatabase,
} from '../../src/helper/db/migration';

const tmpDir = path.join(__dirname, 'tmp');
const testDBFilePath = path.resolve(__dirname, 'old-db.affine');

Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/graphql/src/__tests__/fetcher.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe('GraphQL fetcher', () => {
});

expect(fetch.mock.lastCall[1].body).toMatchInlineSnapshot(
'"{\\"query\\":\\"query { field }\\",\\"variables\\":{\\"a\\":false,\\"b\\":null},\\"operationName\\":\\"query\\"}"'
`"{"query":"query { field }","variables":{"a":false,"b":null},"operationName":"query"}"`
);

await gql({
Expand All @@ -91,7 +91,7 @@ describe('GraphQL fetcher', () => {
});

expect(fetch.mock.lastCall[1].body).toMatchInlineSnapshot(
'"{\\"query\\":\\"query { field }\\",\\"variables\\":{\\"a\\":false},\\"operationName\\":\\"query\\"}"'
`"{"query":"query { field }","variables":{"a":false},"operationName":"query"}"`
);
});

Expand Down
1 change: 1 addition & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default defineConfig({
'**/build',
'**/out,',
'**/frontend/electron',
'packages/backend/**',
],
testTimeout: 5000,
coverage: {
Expand Down

0 comments on commit 8e27503

Please sign in to comment.