File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
packages/router/src/new-route-resolver Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ export class MatcherPatternImpl implements MatcherPattern {
153153 query : MatcherQueryParams
154154 hash : string
155155 } ) {
156- // TODO: is this performant? Compare to a check with `null
156+ // TODO: is this performant? bench compare to a check with `null
157157 try {
158158 return [
159159 this . path . match ( location . path ) ,
Original file line number Diff line number Diff line change 1+ import { describe , expect , it } from 'vitest'
2+ import { MatcherPathStatic } from './path-static'
3+
4+ describe ( 'PathStaticMatcher' , ( ) => {
5+ it ( 'matches' , ( ) => {
6+ expect ( new MatcherPathStatic ( '/' ) . match ( '/' ) ) . toEqual ( { } )
7+ expect ( ( ) => new MatcherPathStatic ( '/' ) . match ( '/no' ) ) . toThrowError ( )
8+ expect ( new MatcherPathStatic ( '/ok/ok' ) . match ( '/ok/ok' ) ) . toEqual ( { } )
9+ expect ( ( ) => new MatcherPathStatic ( '/ok/ok' ) . match ( '/ok/no' ) ) . toThrowError ( )
10+ } )
11+
12+ it ( 'builds path' , ( ) => {
13+ expect ( new MatcherPathStatic ( '/' ) . buildPath ( ) ) . toBe ( '/' )
14+ expect ( new MatcherPathStatic ( '/ok' ) . buildPath ( ) ) . toBe ( '/ok' )
15+ expect ( new MatcherPathStatic ( '/ok/ok' ) . buildPath ( ) ) . toEqual ( '/ok/ok' )
16+ } )
17+ } )
You can’t perform that action at this time.
0 commit comments