Skip to content

Commit

Permalink
Make it possible to no specify a specific fixture name
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe committed Feb 2, 2024
1 parent fbe36ac commit 4fa5db3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/cli/src/testUtils/matchFolderTransform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type Options = {

type MatchFolderTransformFunction = (
transformFunctionOrName: (() => any) | string,
fixtureName: string,
fixtureName?: string,
options?: Options
) => Promise<void>

Expand Down Expand Up @@ -53,7 +53,7 @@ export const matchFolderTransform: MatchFolderTransformFunction = async (
const fixtureFolder = path.join(
testPath,
'../../__testfixtures__',
fixtureName
fixtureName || ''
)

const fixtureInputDir = path.join(fixtureFolder, 'input')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { updateGraphqlConfig } from '../updateGraphqlConfig'

describe('updateGraphQLConfig', () => {
it('Replaces the JS FatalErrorPage with a new version that includes development info', async () => {
await matchFolderTransform(updateGraphqlConfig, 'javascript')
await matchFolderTransform(updateGraphqlConfig)
})
})
4 changes: 2 additions & 2 deletions packages/codemods/src/testUtils/matchFolderTransform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type Options = {

type MatchFolderTransformFunction = (
transformFunctionOrName: (() => any) | string,
fixtureName: string,
fixtureName?: string,
options?: Options
) => Promise<void>

Expand Down Expand Up @@ -47,7 +47,7 @@ export const matchFolderTransform: MatchFolderTransformFunction = async (
const fixtureFolder = path.join(
testPath,
'../../__testfixtures__',
fixtureName
fixtureName || ''
)

const fixtureInputDir = path.join(fixtureFolder, 'input')
Expand Down

0 comments on commit 4fa5db3

Please sign in to comment.