Skip to content

Commit

Permalink
prefer relative imports
Browse files Browse the repository at this point in the history
  • Loading branch information
dcousens committed Mar 28, 2024
1 parent cb51a2c commit 221596e
Show file tree
Hide file tree
Showing 18 changed files with 43 additions and 20 deletions.
3 changes: 2 additions & 1 deletion tests/api-tests/access.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { setupTestSuite } from '@keystone-6/api-tests/test-runner'
import { text } from '@keystone-6/core/fields'
import { list } from '@keystone-6/core'
import { allowAll, denyAll } from '@keystone-6/core/access'

import { setupTestSuite } from './test-runner'
import { dbProvider } from './utils'

function yesNo (x: boolean) {
Expand Down
4 changes: 3 additions & 1 deletion tests/api-tests/admin-meta.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { list } from '@keystone-6/core'
import { allowAll } from '@keystone-6/core/access'
import { integer, text } from '@keystone-6/core/fields'
import { setupTestRunner } from '@keystone-6/api-tests/test-runner'

import { staticAdminMetaQuery } from '../../packages/core/src/admin-ui/admin-meta-graphql'

import { setupTestRunner } from './test-runner'
import { dbProvider } from './utils'

const runner = setupTestRunner({
Expand Down
9 changes: 5 additions & 4 deletions tests/api-tests/auth.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { text, password } from '@keystone-6/core/fields'
import { list } from '@keystone-6/core'
import { statelessSessions } from '@keystone-6/core/session'
import { createAuth } from '@keystone-6/auth'
import { setupTestRunner } from '@keystone-6/api-tests/test-runner'
import { allowAll } from '@keystone-6/core/access'
import { createAuth } from '@keystone-6/auth'
import { statelessSessions } from '@keystone-6/core/session'
import { text, password } from '@keystone-6/core/fields'

import { setupTestRunner } from './test-runner'
import { expectInternalServerError, expectValidationError, seed } from './utils'

const initialData = {
Expand Down
3 changes: 2 additions & 1 deletion tests/api-tests/db-enable-logging.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { list } from '@keystone-6/core'
import { allowAll } from '@keystone-6/core/access'
import { text } from '@keystone-6/core/fields'
import { setupTestRunner } from '@keystone-6/api-tests/test-runner'

import { setupTestRunner } from './test-runner'

const runner = (enableLogging: boolean) =>
setupTestRunner({
Expand Down
1 change: 1 addition & 0 deletions tests/api-tests/db-map.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { list } from '@keystone-6/core'
import { allowAll } from '@keystone-6/core/access'
import { text } from '@keystone-6/core/fields'
import globby from 'globby'

import { dbProvider, getPrismaSchema } from './utils'

test('db.map at the list level adds @@map with the value to the Prisma schema', async () => {
Expand Down
3 changes: 2 additions & 1 deletion tests/api-tests/fields/required.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import os from 'node:os'
import globby from 'globby'
import { list } from '@keystone-6/core'
import { text } from '@keystone-6/core/fields'
import { setupTestRunner } from '@keystone-6/api-tests/test-runner'
import { allowAll } from '@keystone-6/core/access'

import { setupTestRunner } from '../test-runner'
import { humanize } from '../../../packages/core/src/lib/utils'
import {
dbProvider,
Expand Down
3 changes: 2 additions & 1 deletion tests/api-tests/hooks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { list } from '@keystone-6/core'
import { text } from '@keystone-6/core/fields'
import { allowAll } from '@keystone-6/core/access'
import { type KeystoneContext } from '@keystone-6/core/types'
import { setupTestSuite } from '@keystone-6/api-tests/test-runner'

import { setupTestSuite } from './test-runner'

function yn (x: boolean) {
return x ? 'y' : 'n'
Expand Down
4 changes: 3 additions & 1 deletion tests/api-tests/id-field.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { randomBytes } from 'node:crypto'

import { list } from '@keystone-6/core'
import { allowAll } from '@keystone-6/core/access'
import { text } from '@keystone-6/core/fields'
import { setupTestRunner } from '@keystone-6/api-tests/test-runner'
import { validate as isUuid } from 'uuid'

import { setupTestRunner } from './test-runner'
import { dbProvider, expectBadUserInput } from './utils'

export function assertNever (arg: never) {
Expand Down
1 change: 1 addition & 0 deletions tests/api-tests/indexes.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { list } from '@keystone-6/core'
import { allowAll } from '@keystone-6/core/access'
import { select, text } from '@keystone-6/core/fields'

import { setupTestEnv } from './test-runner'
import { dbProvider } from './utils'

Expand Down
3 changes: 2 additions & 1 deletion tests/api-tests/omit.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { setupTestSuite } from '@keystone-6/api-tests/test-runner'
import { relationship, text } from '@keystone-6/core/fields'
import { list } from '@keystone-6/core'
import { allowAll } from '@keystone-6/core/access'
import { type KeystoneContext } from '@keystone-6/core/types'

import { setupTestSuite } from './test-runner'
import { dbProvider } from './utils'

jest.setTimeout(10000000)
Expand Down
1 change: 0 additions & 1 deletion tests/api-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"devDependencies": {
"@apollo/cache-control-types": "^1.0.2",
"@hapi/iron": "^7.0.0",
"@keystone-6/api-tests": "workspace:*",
"@keystone-6/auth": "workspace:*",
"@keystone-6/core": "workspace:*",
"@keystone-6/fields-document": "workspace:*",
Expand Down
5 changes: 3 additions & 2 deletions tests/api-tests/queries/cache-hints.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { maybeCacheControlFromInfo } from '@apollo/cache-control-types'
import { text, relationship, integer } from '@keystone-6/core/fields'
import { list, graphql } from '@keystone-6/core'
import { setupTestRunner } from '@keystone-6/api-tests/test-runner'
import { text, relationship, integer } from '@keystone-6/core/fields'
import { allowAll } from '@keystone-6/core/access'

import { setupTestRunner } from '../test-runner'
import { type ContextFromRunner } from '../utils'

const runner = setupTestRunner({
Expand Down
3 changes: 2 additions & 1 deletion tests/api-tests/queries/filters.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { text, relationship, integer } from '@keystone-6/core/fields'
import { list } from '@keystone-6/core'
import { setupTestRunner } from '@keystone-6/api-tests/test-runner'
import { allowAll } from '@keystone-6/core/access'

import { setupTestRunner } from '../test-runner'
import {
expectAccessReturnError,
expectBadUserInput,
Expand Down
3 changes: 2 additions & 1 deletion tests/api-tests/queries/limits.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { text, integer, relationship } from '@keystone-6/core/fields'
import { list } from '@keystone-6/core'
import { setupTestRunner } from '@keystone-6/api-tests/test-runner'
import { allowAll } from '@keystone-6/core/access'

import { setupTestRunner } from '../test-runner'
import { expectGraphQLValidationError } from '../utils'
import { depthLimit, definitionLimit, fieldLimit } from './validation'

Expand Down
3 changes: 2 additions & 1 deletion tests/api-tests/queries/orderBy.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { integer } from '@keystone-6/core/fields'
import { list } from '@keystone-6/core'
import { setupTestRunner } from '@keystone-6/api-tests/test-runner'
import { allowAll } from '@keystone-6/core/access'
import { type ExecutionResult } from 'graphql'

import { setupTestRunner } from '../test-runner'
import {
expectAccessReturnError,
expectBadUserInput,
Expand Down
5 changes: 3 additions & 2 deletions tests/api-tests/queries/relationships.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { gen, sampleOne } from 'testcheck'

import { text, relationship } from '@keystone-6/core/fields'
import { list } from '@keystone-6/core'
import { setupTestRunner } from '@keystone-6/api-tests/test-runner'
import { text, relationship } from '@keystone-6/core/fields'
import { allowAll } from '@keystone-6/core/access'

import { setupTestRunner } from '../test-runner'
import { type ListKeyFromRunner } from '../utils'

const alphanumGenerator = gen.alphaNumString.notEmpty()
Expand Down
1 change: 1 addition & 0 deletions tests/api-tests/queries/singletons.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { text } from '@keystone-6/core/fields'
import { list } from '@keystone-6/core'
import { type KeystoneContext } from '@keystone-6/core/types'
import { allowAll } from '@keystone-6/core/access'

import { setupTestRunner } from '../test-runner'
import { dbProvider } from '../utils'

Expand Down
8 changes: 7 additions & 1 deletion tests/api-tests/queries/validation.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { visit, Kind, type ValidationContext, type ASTNode, type ASTVisitor } from 'graphql'
import {
type ASTNode,
type ASTVisitor,
type ValidationContext,
Kind,
visit,
} from 'graphql'

type Fragment = { name: string, atDepth: number }

Expand Down

0 comments on commit 221596e

Please sign in to comment.