Skip to content

Commit

Permalink
pass configFile to match tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AlecAivazis committed Mar 29, 2024
1 parent b96c400 commit a4cd3cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/houdini/src/runtime/router/match.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { test, expect, describe } from 'vitest'

import { testConfigFile } from '../../test'
import { exec, find_match, parse_page_pattern } from './match'
import type { RouterManifest } from './types'

Expand Down Expand Up @@ -137,8 +138,10 @@ describe('find_match parse and match', async function () {
),
}

const configFile = testConfigFile()

// find the match
const [match] = find_match(manifest, expected)
const [match] = find_match(configFile, manifest, expected)
expect(match?.id).toEqual(expected)
})
}
Expand Down
1 change: 1 addition & 0 deletions packages/houdini/src/runtime/router/match.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export function find_match<_ComponentType>(
// find the matching path (if it exists)
let match: RouterPageManifest<_ComponentType> | null = null
let matchVariables: GraphQLVariables = null

for (const page of Object.values(manifest.pages)) {
// check if the current url matches
const urlMatch = current.match(page.pattern)
Expand Down

0 comments on commit a4cd3cb

Please sign in to comment.