Skip to content

Commit

Permalink
chore: explicitly import from vitests (#2479)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasdiez authored Aug 1, 2024
1 parent 5a7859b commit fe708f0
Show file tree
Hide file tree
Showing 15 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions server/api.e2e.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { gql as gqlNotVerified } from 'graphql-tag'
import { describe, expect, it } from 'vitest'
import { api, root } from '~/test/api-e2e/supertest'

describe('invalid query', () => {
Expand Down
1 change: 1 addition & 0 deletions server/database/integration.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { afterAll, beforeEach, describe, expect, it } from 'vitest'
import * as prisma from '~/server/database/util'
import { resolve } from '../tsyringe'

Expand Down
1 change: 1 addition & 0 deletions server/documents/integration.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { gql } from 'graphql-tag'
import { afterAll, beforeEach, describe, expect, it } from 'vitest'
import * as prisma from '~/server/database/util'
import { createAuthenticatedClient } from '~/test/apollo.server'
import { removeIds } from '~/test/util'
Expand Down
1 change: 1 addition & 0 deletions server/documents/resolvers.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { beforeEach, describe, expect, it } from 'vitest'
import { mock, mockReset } from 'vitest-mock-extended'
import { createUnauthenticatedContext } from '~/test/context.helper'
import { register, resolve } from '../tsyringe'
Expand Down
1 change: 1 addition & 0 deletions server/documents/user.document.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { PrismaClient } from '@prisma/client'
import { beforeEach, describe, expect, it } from 'vitest'
import { mockDeep, mockReset } from 'vitest-mock-extended'
import { register, resolve } from '../tsyringe'
import type { UserDocument } from './user.document.service'
Expand Down
1 change: 1 addition & 0 deletions server/e2e.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, expect, it } from 'vitest'
import { root } from '~/test/api-e2e/supertest'

describe('index page', () => {
Expand Down
1 change: 1 addition & 0 deletions server/getLatestRelease.e2e.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { InternalApi } from 'nitropack'
import { expect, test } from 'vitest'
import { root } from '~/test/api-e2e/supertest'

type GetLatestReleaseResponse = InternalApi['/api/getLatestRelease']['default']
Expand Down
1 change: 1 addition & 0 deletions server/journals/journal.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Journal, PrismaClient } from '@prisma/client'
import { beforeEach, describe, expect, it } from 'vitest'
import { mockDeep, mockReset } from 'vitest-mock-extended'
import { register, resolve } from '../tsyringe'

Expand Down
2 changes: 1 addition & 1 deletion server/user/e2e.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { gql } from 'graphql-tag'
import { test } from 'vitest'
import { describe, expect, it, test } from 'vitest'
import { api, login } from '~/test/api-e2e/supertest'
import { getEmail, getTemporaryEmail } from '~/test/email'

Expand Down
1 change: 1 addition & 0 deletions server/user/integration.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { gql } from 'graphql-tag'
import { afterAll, beforeEach, describe, expect, it } from 'vitest'
import * as prisma from '~/server/database/util'
import { createAuthenticatedClient } from '~/test/apollo.server'

Expand Down
1 change: 1 addition & 0 deletions server/user/resolvers.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { beforeEach, describe, expect, it } from 'vitest'
import { mock, mockReset } from 'vitest-mock-extended'
import { createUnauthenticatedContext } from '~/test/context.helper'
import { register, resolve } from '../tsyringe'
Expand Down
1 change: 1 addition & 0 deletions server/utils/crypto.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, expect, it } from 'vitest'
import { hash, verifyHash } from './crypto'

describe('hash', () => {
Expand Down
1 change: 1 addition & 0 deletions server/utils/validation.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { describe, expect, it } from 'vitest'
import { z } from 'zod'
import { validateInput, validation } from './validation'

Expand Down
2 changes: 1 addition & 1 deletion test/global.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import prisma from '@prisma/client'
import 'dotenv/config'
import 'json-bigint-patch'
import 'reflect-metadata'
import { beforeAll } from 'vitest'
import { beforeAll, expect } from 'vitest'
import { constructConfig } from '~/config'
import { register } from '~/server/tsyringe'
import { registerClasses } from '~/server/tsyringe.config'
Expand Down
4 changes: 0 additions & 4 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ export default defineVitestConfig({
},
},
test: {
// Provide global API
// https://vitest.dev/config/#globals
globals: true,

// Run before each test file
// https://vitest.dev/config/#setupfiles
setupFiles: ['test/global.setup.ts'],
Expand Down

0 comments on commit fe708f0

Please sign in to comment.