Skip to content

Commit

Permalink
add tests/dynamic-catchall.test.ts again
Browse files Browse the repository at this point in the history
  • Loading branch information
itelo committed Aug 11, 2023
1 parent 26f6a41 commit 5a8c301
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/dynamic-catchall.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import test from "ava"
import getPort from "get-port"
import axios from "axios"
import { getSampleProject } from "./fixtures/get-sample-project"

test("dynamic catchall path", async (t) => {
const { getNsmIndex } = await getSampleProject()
const port = await getPort()

const server = await getNsmIndex({ port })

const {
data: { query, requestUrl },
} = await axios.get(
`http://localhost:${port}/dir2/some/route/params?searchParam=a-value`
)

t.is(requestUrl, "/dir2/some/route/params?searchParam=a-value")

t.deepEqual(query, {
param3: ["some", "route", "params"],
searchParam: "a-value",
})

server.close()
})

0 comments on commit 5a8c301

Please sign in to comment.