File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import type {
1010} from "@webdoc/types" ;
1111import { nanoid } from "nanoid" ;
1212
13- const CANONICAL_SEPARATOR = / ( [ . # ~ $ ] ) / ;
13+ const CANONICAL_SEPARATOR = / ( [ . # ~ $ ] ) / g ;
1414
1515function updateScope ( doc : Doc , scopeStack : string [ ] , scopePath : string ) : void {
1616 if ( scopePath ) {
Original file line number Diff line number Diff line change 1+ const { createDoc} = require ( "../" ) ;
2+
3+ const expect = require ( "chai" ) . expect ;
4+
5+ describe ( "@webdoc/model/doc" , function ( ) {
6+ describe ( "createDoc" , function ( ) {
7+ it ( "should correctly infer scope from the canonical name" , function ( ) {
8+ const mixinMetadata = createDoc ( "API.MixinBase#mixinMetadata" , "MemberDoc" ) ;
9+ const mixinState = createDoc ( "API.MixinBase~mixinState" , "ObjectDoc" ) ;
10+ const mixinFactory = createDoc ( "API~MixinFactory.build" , "MethodDoc" ) ;
11+
12+ expect ( mixinMetadata . scope ) . to . equal ( "instance" ) ;
13+ expect ( mixinState . scope ) . to . equal ( "inner" ) ;
14+ expect ( mixinFactory . scope ) . to . equal ( "static" ) ;
15+ } ) ;
16+ } ) ;
17+ } ) ;
You can’t perform that action at this time.
0 commit comments