Skip to content

Commit

Permalink
test: update inline snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
KeJunMao committed Apr 6, 2023
1 parent 4e0658d commit 128baa5
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 20 deletions.
18 changes: 9 additions & 9 deletions test/generate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,24 @@ describe('Generate routes', () => {

expect(routes).toMatchInlineSnapshot(`
"[
{
\\"path\\": \\"../packages/playground/src/pages/index\\",
\\"type\\": \\"page\\",
\\"middlewares\\": [
\\"auth\\",
\\"test\\"
]
},
{
\\"path\\": \\"../packages/playground/src/pages/test-json\\",
\\"type\\": \\"page\\",
\\"type\\": \\"home\\",
\\"style\\": {
\\"navigationBarTitleText\\": \\"test json page\\"
},
\\"middlewares\\": [
\\"auth\\"
]
},
{
\\"path\\": \\"../packages/playground/src/pages/index\\",
\\"type\\": \\"page\\",
\\"middlewares\\": [
\\"auth\\",
\\"test\\"
]
},
{
\\"path\\": \\"../packages/playground/src/pages/test-yaml\\",
\\"type\\": \\"page\\",
Expand Down
33 changes: 22 additions & 11 deletions test/parser.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { resolve } from 'path'
import { resolve } from 'node:path'
import { describe, expect, test } from 'vitest'
import { getRouteBlock, resolveOptions } from '../packages/core/src/index'

Expand All @@ -12,11 +12,16 @@ describe('Parser', () => {
const routeBlock = await getRouteBlock(path, options)
expect(routeBlock).toMatchInlineSnapshot(`
{
"middlewares": [
"auth",
],
"style": {
"navigationBarTitleText": "test json page",
"attr": {
"type": "home",
},
"content": {
"middlewares": [
"auth",
],
"style": {
"navigationBarTitleText": "test json page",
},
},
}
`)
Expand All @@ -27,11 +32,17 @@ describe('Parser', () => {
const routeBlock = await getRouteBlock(path, options)
expect(routeBlock).toMatchInlineSnapshot(`
{
"middlewares": [
"auth",
],
"style": {
"navigationBarTitleText": "test yaml page",
"attr": {
"lang": "yaml",
"type": "page",
},
"content": {
"middlewares": [
"auth",
],
"style": {
"navigationBarTitleText": "test yaml page",
},
},
}
`)
Expand Down

0 comments on commit 128baa5

Please sign in to comment.