forked from codesandbox/codesandbox-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget-dependency-name.test.ts
More file actions
31 lines (25 loc) · 1012 Bytes
/
get-dependency-name.test.ts
File metadata and controls
31 lines (25 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import getDependencyName from './get-dependency-name';
describe('getDependencyName', () => {
it('can find a simple dependency name', () => {
expect(getDependencyName('lodash/test')).toBe('lodash');
});
it('can find a simple dependency name from no path', () => {
expect(getDependencyName('lodash')).toBe('lodash');
});
it('can find a simple dependency name from an organization', () => {
expect(getDependencyName('@angular/core/test')).toBe('@angular/core');
});
it('can find a simple dependency name with a version', () => {
expect(getDependencyName('lodash/4.4.3/test')).toBe('lodash/4.4.3');
});
it('can find a simple dependency name with a version from an organization', () => {
expect(getDependencyName('@angular/core/4.4.3/test')).toBe(
'@angular/core/4.4.3'
);
});
it('can find a simple dependency name with beta tag', () => {
expect(getDependencyName('reakit/1.0.0-beta.16/lib/Component')).toBe(
'reakit/1.0.0-beta.16'
);
});
});