Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 598640b

Browse files
committed
Fix unit test that relied on the old @microsoft scope
1 parent 3cb5027 commit 598640b

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

‎libraries/node-core-library/src/test/PackageName.test.ts‎

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ describe('PackageName', () => {
77
describe('Test', () => {
88

99
test('isValidName() positive test', () => {
10-
expect(PackageName.isValidName('@rushstack/node-core-library')).toEqual(true);
10+
expect(PackageName.isValidName('@microsoft/example-package')).toEqual(true);
1111
});
1212

1313
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);
1515
});
1616

1717
test('tryParse() tests', () => {
1818
expect(
19-
PackageName.tryParse('@rushstack/node-core-library')
19+
PackageName.tryParse('@microsoft/example-package')
2020
).toEqual(
2121
{
2222
scope: '@microsoft',
23-
unscopedName: 'node-core-library',
23+
unscopedName: 'example-package',
2424
error: ''
2525
}
2626
);
@@ -56,32 +56,32 @@ describe('PackageName', () => {
5656
);
5757

5858
expect(
59-
PackageName.tryParse('@/node-core-library')
59+
PackageName.tryParse('@/example-package')
6060
).toEqual(
6161
{
6262
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'
6565
}
6666
);
6767

6868
expect(
69-
PackageName.tryParse('@rushstack/node-core-library')
69+
PackageName.tryParse('@Microsoft/example-package')
7070
).toEqual(
7171
{
7272
scope: '@Microsoft',
73-
unscopedName: 'node-core-library',
73+
unscopedName: 'example-package',
7474
error: 'The package scope "@Microsoft" must not contain upper case characters'
7575
}
7676
);
7777

7878
expect(
79-
PackageName.tryParse('@micro!soft/node-core-library')
79+
PackageName.tryParse('@micro!soft/example-package')
8080
).toEqual(
8181
{
8282
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: \"!\"'
8585
}
8686
);
8787

@@ -96,12 +96,12 @@ describe('PackageName', () => {
9696
);
9797

9898
expect(
99-
PackageName.tryParse('@rushstack/node-core-library/path')
99+
PackageName.tryParse('@microsoft/example-package/path')
100100
).toEqual(
101101
{
102102
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: \"/\"'
105105
}
106106
);
107107

@@ -115,21 +115,21 @@ describe('PackageName', () => {
115115
});
116116

117117
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');
120120

121-
expect(PackageName.combineParts('', 'node-core-library'))
122-
.toEqual('node-core-library');
121+
expect(PackageName.combineParts('', 'example-package'))
122+
.toEqual('example-package');
123123
});
124124

125125
test('combineParts() errors', () => {
126126
expect(() => {
127-
PackageName.combineParts('', '@rushstack/node-core-library');
127+
PackageName.combineParts('', '@microsoft/example-package');
128128
}).toThrowError('The unscopedName cannot start with an "@" character');
129129

130130
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: "!"');
133133

134134
expect(() => {
135135
PackageName.combineParts('', '');

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /