Skip to content

Commit

Permalink
fix(types): Fix TS type in createServer.test.ts (#10023)
Browse files Browse the repository at this point in the history
Because it's only a type import it's safe to do this. All type imports
are removed when building/running. They're just there for TS's sake.
  • Loading branch information
Tobbe authored Feb 16, 2024
1 parent 4891360 commit ad493cd
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/api-server/src/__tests__/createServer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import type { MockInstance } from 'vitest'

import { getConfig } from '@redwoodjs/project-config'

import type { createServer as tCreateServer } from '../createServer.js'
import {
resolveOptions,
DEFAULT_CREATE_SERVER_OPTIONS,
Expand All @@ -23,11 +24,7 @@ import {
// Set up RWJS_CWD.
let original_RWJS_CWD: string | undefined

// We have to asynchronously import the module because it relies on RWJS_CWD being set.
// TODO(jtoar): The lint rule below is complaining about the import,
// but I'm not sure what else to do at the moment. Happy to take suggestions!
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
let createServer: typeof import('../createServer.js').createServer
let createServer: typeof tCreateServer

beforeAll(async () => {
original_RWJS_CWD = process.env.RWJS_CWD
Expand Down

0 comments on commit ad493cd

Please sign in to comment.