@@ -7,20 +7,20 @@ describe('PackageName', () => {
7
7
describe ( 'Test' , ( ) => {
8
8
9
9
test ( 'isValidName() positive test' , ( ) => {
10
- expect ( PackageName . isValidName ( '@rushstack/node-core-library ' ) ) . toEqual ( true ) ;
10
+ expect ( PackageName . isValidName ( '@microsoft/example-package ' ) ) . toEqual ( true ) ;
11
11
} ) ;
12
12
13
13
test ( 'isValidName() negative test' , ( ) => {
14
- expect ( PackageName . isValidName ( '@rushstack/node-core-library /path' ) ) . toEqual ( false ) ;
14
+ expect ( PackageName . isValidName ( '@microsoft/example-package /path' ) ) . toEqual ( false ) ;
15
15
} ) ;
16
16
17
17
test ( 'tryParse() tests' , ( ) => {
18
18
expect (
19
- PackageName . tryParse ( '@rushstack/node-core-library ' )
19
+ PackageName . tryParse ( '@microsoft/example-package ' )
20
20
) . toEqual (
21
21
{
22
22
scope : '@microsoft' ,
23
- unscopedName : 'node-core-library ' ,
23
+ unscopedName : 'example-package ' ,
24
24
error : ''
25
25
}
26
26
) ;
@@ -56,32 +56,32 @@ describe('PackageName', () => {
56
56
) ;
57
57
58
58
expect (
59
- PackageName . tryParse ( '@/node-core-library ' )
59
+ PackageName . tryParse ( '@/example-package ' )
60
60
) . toEqual (
61
61
{
62
62
scope : '@' ,
63
- unscopedName : 'node-core-library ' ,
64
- error : 'Error parsing "@/node-core-library ": The scope name cannot be empty'
63
+ unscopedName : 'example-package ' ,
64
+ error : 'Error parsing "@/example-package ": The scope name cannot be empty'
65
65
}
66
66
) ;
67
67
68
68
expect (
69
- PackageName . tryParse ( '@rushstack/node-core-library ' )
69
+ PackageName . tryParse ( '@Microsoft/example-package ' )
70
70
) . toEqual (
71
71
{
72
72
scope : '@Microsoft' ,
73
- unscopedName : 'node-core-library ' ,
73
+ unscopedName : 'example-package ' ,
74
74
error : 'The package scope "@Microsoft" must not contain upper case characters'
75
75
}
76
76
) ;
77
77
78
78
expect (
79
- PackageName . tryParse ( '@micro!soft/node-core-library ' )
79
+ PackageName . tryParse ( '@micro!soft/example-package ' )
80
80
) . toEqual (
81
81
{
82
82
scope : '@micro!soft' ,
83
- unscopedName : 'node-core-library ' ,
84
- error : 'The package name "@micro!soft/node-core-library " contains an invalid character: \"!\"'
83
+ unscopedName : 'example-package ' ,
84
+ error : 'The package name "@micro!soft/example-package " contains an invalid character: \"!\"'
85
85
}
86
86
) ;
87
87
@@ -96,12 +96,12 @@ describe('PackageName', () => {
96
96
) ;
97
97
98
98
expect (
99
- PackageName . tryParse ( '@rushstack/node-core-library /path' )
99
+<
8000
/span> PackageName . tryParse ( '@microsoft/example-package /path' )
100
100
) . toEqual (
101
101
{
102
102
scope : '@microsoft' ,
103
- unscopedName : 'node-core-library /path' ,
104
- error : 'The package name "@rushstack/node-core-library /path" contains an invalid character: \"/\"'
103
+ unscopedName : 'example-package /path' ,
104
+ error : 'The package name "@microsoft/example-package /path" contains an invalid character: \"/\"'
105
105
}
106
106
) ;
107
107
@@ -115,21 +115,21 @@ describe('PackageName', () => {
115
115
} ) ;
116
116
117
117
test ( 'combineParts() tests' , ( ) => {
118
- expect ( PackageName . combineParts ( '@microsoft' , 'node-core-library ' ) )
119
- . toEqual ( '@rushstack/node-core-library ' ) ;
118
+ expect ( PackageName . combineParts ( '@microsoft' , 'example-package ' ) )
119
+ . toEqual ( '@microsoft/example-package ' ) ;
120
120
121
- expect ( PackageName . combineParts ( '' , 'node-core-library ' ) )
122
- . toEqual ( 'node-core-library ' ) ;
121
+ expect ( PackageName . combineParts ( '' , 'example-package ' ) )
122
+ . toEqual ( 'example-package ' ) ;
123
123
} ) ;
124
124
125
125
test ( 'combineParts() errors' , ( ) => {
126
126
expect ( ( ) => {
127
- PackageName . combineParts ( '' , '@rushstack/node-core-library ' ) ;
127
+ PackageName . combineParts ( '' , '@microsoft/example-package ' ) ;
128
128
} ) . toThrowError ( 'The unscopedName cannot start with an "@" character' ) ;
129
129
130
130
expect ( ( ) => {
131
- PackageName . combineParts ( '@micr!osoft' , 'node-core-library ' ) ;
132
- } ) . toThrowError ( 'The package name "@micr!osoft/node-core-library " contains an invalid character: "!"' ) ;
131
+ PackageName . combineParts ( '@micr!osoft' , 'example-package ' ) ;
132
+ } ) . toThrowError ( 'The package name "@micr!osoft/example-package " contains an invalid character: "!"' ) ;
133
133
134
134
expect ( ( ) => {
135
135
PackageName . combineParts ( '' , '' ) ;
0 commit comments