Skip to content

Commit

Permalink
chore: write repro
Browse files Browse the repository at this point in the history
  • Loading branch information
Skn0tt committed Apr 26, 2024
1 parent b0e1041 commit 909bebc
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions tests/integration/commands/dev/dev-miscellaneous.test.js
Expand Up @@ -930,6 +930,46 @@ describe.concurrent('commands/dev-miscellaneous', () => {
})
})

test('should respect excluded paths specified in TOML', async (t) => {
await withSiteBuilder(t, async (builder) => {
const publicDir = 'public'
builder
.withNetlifyToml({
config: {
build: {
publish: publicDir,
edge_functions: 'netlify/edge-functions',
},
edge_functions: [
{
function: 'hello',
path: '/*',
excludedPath: '/static/*',
},
],
},
})
.withEdgeFunction({
handler: () => new Response('Hello world'),
name: 'hello',
})

await builder.build()

await withDevServer({ cwd: builder.directory }, async ({ port }) => {
const [res1, res2] = await Promise.all([
fetch(`http://localhost:${port}/foo`),
fetch(`http://localhost:${port}/static/foo`),
])

t.expect(res1.status).toBe(200)
t.expect(await res1.text()).toEqual('Hello world')

t.expect(res2.status).toBe(404)
})
})
})

test('should respect in-source configuration from internal edge functions', async (t) => {
await withSiteBuilder(t, async (builder) => {
const publicDir = 'public'
Expand Down

0 comments on commit 909bebc

Please sign in to comment.