Skip to content

Commit 49ee966

Browse files
committed
test: remove old matcher refs
1 parent a02cab6 commit 49ee966

File tree

1 file changed

+19
-28
lines changed

1 file changed

+19
-28
lines changed

packages/router/src/new-route-resolver/matcher-resolve.spec.ts

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
1-
import { createRouterMatcher } from '../matcher'
2-
import { RouteComponent, RouteRecordRaw } from '../types'
1+
import { describe, expect, it } from 'vitest'
32
import { defineComponent } from 'vue'
3+
import { RouteComponent, RouteRecordRaw } from '../types'
44
import { stringifyURL } from '../location'
5-
import { describe, expect, it } from 'vitest'
65
import { mockWarn } from '../../__tests__/vitest-mock-warn'
76
import {
87
createCompiledMatcher,
9-
MatcherLocationRaw,
10-
NEW_MatcherRecordRaw,
11-
NEW_LocationResolved,
12-
NEW_MatcherRecord,
8+
type MatcherLocationRaw,
9+
type NEW_MatcherRecordRaw,
10+
type NEW_LocationResolved,
11+
type NEW_MatcherRecord,
1312
} from './resolver'
14-
import { PathParams, tokensToParser } from '../matcher/pathParserRanker'
15-
import { tokenizePath } from '../matcher/pathTokenizer'
1613
import { miss } from './matchers/errors'
17-
import { MatcherPatternPath } from './matcher-pattern'
18-
import { EXPERIMENTAL_RouteRecordRaw } from '../experimental/router'
14+
import { MatcherPatternPath, MatcherPatternPathStatic } from './matcher-pattern'
15+
import { type EXPERIMENTAL_RouteRecordRaw } from '../experimental/router'
1916
import { stringifyQuery } from '../query'
20-
import {
17+
import type {
2118
MatcherLocationAsNamed,
2219
MatcherLocationAsPathAbsolute,
2320
} from './matcher-location'
21+
// TODO: should be moved to a different test file
22+
// used to check backward compatible paths
23+
import { PathParams, tokensToParser } from '../matcher/pathParserRanker'
24+
import { tokenizePath } from '../matcher/pathTokenizer'
2425

2526
// for raw route record
2627
const component: RouteComponent = defineComponent({})
@@ -464,22 +465,12 @@ describe('RouterMatcher.resolve', () => {
464465
})
465466

466467
describe.skip('LocationAsRelative', () => {
467-
it('warns if a path isn not absolute', () => {
468-
const record = {
469-
path: '/parent',
470-
components,
471-
}
472-
const matcher = createRouterMatcher([record], {})
473-
matcher.resolve(
474-
{ path: 'two' },
475-
{
476-
path: '/parent/one',
477-
name: undefined,
478-
params: {},
479-
matched: [] as any,
480-
meta: {},
481-
}
482-
)
468+
// TODO: not sure where this warning should appear now
469+
it.todo('warns if a path isn not absolute', () => {
470+
const matcher = createCompiledMatcher([
471+
{ path: new MatcherPatternPathStatic('/') },
472+
])
473+
matcher.resolve('two', matcher.resolve('/'))
483474
expect('received "two"').toHaveBeenWarned()
484475
})
485476

0 commit comments

Comments
 (0)