Skip to content

Commit 289bb3d

Browse files
committed
use NO_COLOR for tests
1 parent 7e8f946 commit 289bb3d

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

vike/node/runtime/renderPage/resolveRedirects.spec.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,22 @@ describe('resolveRouteStringRedirect', () => {
2626
})
2727
it('handles invalid redirects', () => {
2828
expect(() => resolveRouteStringRedirect('a', 'b', '/')).toThrowErrorMatchingInlineSnapshot(
29-
`[Error: [vike][1m[31m[Wrong Usage][39m[22m[+redirects] Invalid Route String [36ma[39m: it should start with [36m/[39m or [36m*[39m]`
29+
`[Error: [vike][Wrong Usage][+redirects] Invalid Route String a: it should start with / or *]`
3030
)
3131
expect(() => resolveRouteStringRedirect('/a', 'b', '/')).toThrowErrorMatchingInlineSnapshot(
32-
`[Error: [vike][1m[31m[Wrong Usage][39m[22m[+redirects] The URL redirection target is [36mb[39m but it should start with [36m/[39m or a protocol ([36mhttp://[39m, [36mmailto:[39m, ...), or be [36m*[39m]`
32+
`[Error: [vike][Wrong Usage][+redirects] The URL redirection target is 'b' but it should start with '/' or a protocol ('http://', 'mailto:', ...), or be '*']`
3333
)
3434
expect(() => resolveRouteStringRedirect('/a', '/@i', '/')).toThrowErrorMatchingInlineSnapshot(
35-
`[Error: [vike][1m[31m[Wrong Usage][39m[22m[+redirects] The redirection source URL [36m/a[39m is missing the URL parameter [36m@i[39m used by the redirection target URL [36m/@i[39m]`
35+
`[Error: [vike][Wrong Usage][+redirects] The redirection source URL '/a' is missing the URL parameter '@i' used by the redirection target URL '/@i']`
3636
)
3737
expect(() => resolveRouteStringRedirect('/a', '/b/*', '/')).toThrowErrorMatchingInlineSnapshot(
38-
`[Error: [vike][1m[31m[Wrong Usage][39m[22m[+redirects] The redirection source URL [36m/a[39m is missing the URL parameter [36m*[39m used by the redirection target URL [36m/b/*[39m]`
38+
`[Error: [vike][Wrong Usage][+redirects] The redirection source URL '/a' is missing the URL parameter '*' used by the redirection target URL '/b/*']`
3939
)
4040
expect(() => resolveRouteStringRedirect('/', '/*', '/')).toThrowErrorMatchingInlineSnapshot(
41-
`[Error: [vike][1m[31m[Wrong Usage][39m[22m[+redirects] The redirection source URL [36m/[39m is missing the URL parameter [36m*[39m used by the redirection target URL [36m/*[39m]`
41+
`[Error: [vike][Wrong Usage][+redirects] The redirection source URL '/' is missing the URL parameter '*' used by the redirection target URL '/*']`
4242
)
4343
expect(() => resolveRouteStringRedirect('/', '*', '/')).toThrowErrorMatchingInlineSnapshot(
44-
`[Error: [vike][1m[31m[Wrong Usage][39m[22m[+redirects] The redirection source URL [36m/[39m is missing the URL parameter [36m*[39m used by the redirection target URL [36m*[39m]`
44+
`[Error: [vike][Wrong Usage][+redirects] The redirection source URL '/' is missing the URL parameter '*' used by the redirection target URL '*']`
4545
)
4646
})
4747
it('globs', () => {

vitest.workspace.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
import { defineWorkspace } from 'vitest/config'
22

3+
const env = {
4+
NO_COLOR: '1'
5+
}
6+
37
export default defineWorkspace([
48
{
59
test: {
610
include: ['vike/**/*.spec.ts'],
711
name: 'unit',
8-
env: {
9-
FORCE_COLOR: '1'
10-
}
12+
env
1113
}
1214
},
1315
{
1416
test: {
1517
// test/**/*.test.ts => @brillout/test-e2e
1618
include: ['test/**/*.spec.ts'],
17-
name: 'e2e'
19+
name: 'e2e',
20+
env
1821
}
1922
}
2023
])

0 commit comments

Comments
 (0)