Commit add2ec93 authored by Cursor Agent's avatar Cursor Agent Committed by devjiwonchoi

Fix test assertions for debug-build-paths match logging

The new log message 'Pattern "..." did match N files' includes the
pattern itself, which may contain excluded paths like '/with-type-error'
as part of negation patterns. Update test assertions to check for the
route format in the build output (e.g., '○ /route' or 'ƒ /route')
rather than just checking if the path appears anywhere in the output.
parent 4a60e31a
...@@ -159,8 +159,8 @@ describe('debug-build-paths', () => { ...@@ -159,8 +159,8 @@ describe('debug-build-paths', () => {
expect(buildResult.cliOutput).toContain('○ /about') expect(buildResult.cliOutput).toContain('○ /about')
expect(buildResult.cliOutput).toContain('○ /dashboard') expect(buildResult.cliOutput).toContain('○ /dashboard')
expect(buildResult.cliOutput).toContain('/blog/[slug]') expect(buildResult.cliOutput).toContain('/blog/[slug]')
// Should not build routes not specified // Should not build routes not specified (check route format, not just substring)
expect(buildResult.cliOutput).not.toContain('/with-type-error') expect(buildResult.cliOutput).not.toMatch(/[○ƒ] \/with-type-error/)
// Should not build pages routes // Should not build pages routes
expect(buildResult.cliOutput).not.toContain('Route (pages)') expect(buildResult.cliOutput).not.toContain('Route (pages)')
}) })
...@@ -179,7 +179,8 @@ describe('debug-build-paths', () => { ...@@ -179,7 +179,8 @@ describe('debug-build-paths', () => {
expect(buildResult.cliOutput).toContain('○ /about') expect(buildResult.cliOutput).toContain('○ /about')
expect(buildResult.cliOutput).toContain('○ /dashboard') expect(buildResult.cliOutput).toContain('○ /dashboard')
expect(buildResult.cliOutput).toContain('/blog/[slug]') expect(buildResult.cliOutput).toContain('/blog/[slug]')
expect(buildResult.cliOutput).not.toContain('/with-type-error') // Check that the route is not in the build output (not just anywhere in the log)
expect(buildResult.cliOutput).not.toMatch(/[○ƒ] \/with-type-error/)
}) })
it('should exclude dynamic route paths with negation', async () => { it('should exclude dynamic route paths with negation', async () => {
...@@ -193,7 +194,10 @@ describe('debug-build-paths', () => { ...@@ -193,7 +194,10 @@ describe('debug-build-paths', () => {
expect(buildResult.cliOutput).toContain('Route (app)') expect(buildResult.cliOutput).toContain('Route (app)')
expect(buildResult.cliOutput).toContain('/blog/[slug]') expect(buildResult.cliOutput).toContain('/blog/[slug]')
expect(buildResult.cliOutput).not.toContain('/blog/[slug]/comments') // Check that the route is not in the build output (not just anywhere in the log)
expect(buildResult.cliOutput).not.toMatch(
/[○ƒ] \/blog\/\[slug\]\/comments/
)
}) })
it('should support multiple negation patterns', async () => { it('should support multiple negation patterns', async () => {
...@@ -208,7 +212,8 @@ describe('debug-build-paths', () => { ...@@ -208,7 +212,8 @@ describe('debug-build-paths', () => {
expect(buildResult.cliOutput).toContain('Route (app)') expect(buildResult.cliOutput).toContain('Route (app)')
expect(buildResult.cliOutput).toContain('○ /') expect(buildResult.cliOutput).toContain('○ /')
expect(buildResult.cliOutput).toContain('○ /about') expect(buildResult.cliOutput).toContain('○ /about')
expect(buildResult.cliOutput).not.toContain('/with-type-error') // Check that routes are not in the build output (not just anywhere in the log)
expect(buildResult.cliOutput).not.toMatch(/[○ƒ] \/with-type-error/)
expect(buildResult.cliOutput).not.toContain('○ /dashboard') expect(buildResult.cliOutput).not.toContain('○ /dashboard')
}) })
...@@ -223,7 +228,8 @@ describe('debug-build-paths', () => { ...@@ -223,7 +228,8 @@ describe('debug-build-paths', () => {
expect(buildResult.cliOutput).toContain('○ /') expect(buildResult.cliOutput).toContain('○ /')
expect(buildResult.cliOutput).toContain('○ /about') expect(buildResult.cliOutput).toContain('○ /about')
expect(buildResult.cliOutput).toContain('○ /foo') expect(buildResult.cliOutput).toContain('○ /foo')
expect(buildResult.cliOutput).not.toContain('/with-type-error') // Check that the route is not in the build output (not just anywhere in the log)
expect(buildResult.cliOutput).not.toMatch(/[○ƒ] \/with-type-error/)
}) })
it('should build routes inside route groups', async () => { it('should build routes inside route groups', async () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment