From 0113b439ff3a8922772c5f6841b2e522d3fe89d1 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Fri, 8 Dec 2023 14:23:46 +0800 Subject: [PATCH] test: fix for vitest upgrade --- packages/frontend/electron/test/db/migration.spec.ts | 9 +++++---- packages/frontend/graphql/src/__tests__/fetcher.spec.ts | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/frontend/electron/test/db/migration.spec.ts b/packages/frontend/electron/test/db/migration.spec.ts index 809e05e3b8424..33a624012df74 100644 --- a/packages/frontend/electron/test/db/migration.spec.ts +++ b/packages/frontend/electron/test/db/migration.spec.ts @@ -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'); diff --git a/packages/frontend/graphql/src/__tests__/fetcher.spec.ts b/packages/frontend/graphql/src/__tests__/fetcher.spec.ts index 50369f6fb39af..586293ae0aa55 100644 --- a/packages/frontend/graphql/src/__tests__/fetcher.spec.ts +++ b/packages/frontend/graphql/src/__tests__/fetcher.spec.ts @@ -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({ @@ -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"}"` ); });