Son CV dans un terminal web en Javascript!
https://terminal-cv.gregandev.fr
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.0 KiB
38 lines
1.0 KiB
// @flow
|
|
import assert from 'assert';
|
|
|
|
import validateModuleSpecifier from '../src/validateModuleSpecifier';
|
|
|
|
describe('Validate Module Specifiers', () => {
|
|
it('Validate Module Specifiers', () => {
|
|
let modules = [
|
|
'@parcel/transformer-posthtml/package.json',
|
|
'@some-org/package@v1.0.0',
|
|
'@org/some-package@v1.0.0-alpha.1',
|
|
'something.js/something/index.js',
|
|
'@some.org/something.js/index.js',
|
|
'lodash/something/index.js',
|
|
];
|
|
|
|
assert.deepEqual(
|
|
modules.map(module => validateModuleSpecifier(module)),
|
|
[
|
|
'@parcel/transformer-posthtml',
|
|
'@some-org/package@v1.0.0',
|
|
'@org/some-package@v1.0.0-alpha.1',
|
|
'something.js',
|
|
'@some.org/something.js',
|
|
'lodash',
|
|
],
|
|
);
|
|
});
|
|
|
|
it('Return empty on invalid modules', () => {
|
|
let modules = ['./somewhere.js', './hello/world.js', '~/hello/world.js'];
|
|
|
|
assert.deepEqual(
|
|
modules.map(module => validateModuleSpecifier(module)),
|
|
['', '', ''],
|
|
);
|
|
});
|
|
});
|
|
|