2018-01-15 02:06:36 +00:00
|
|
|
import packageJSON from '../package.json';
|
|
|
|
|
|
|
|
// from https://docs.npmjs.com/files/package.json#dependencies
|
|
|
|
const nonExactPrefixes = ['~', '^', '>', '>=', '<', '<='];
|
|
|
|
|
|
|
|
describe('package.json', () => {
|
|
|
|
it('dependencies should not contain any non-exact versions', () => {
|
2018-03-28 19:34:29 +00:00
|
|
|
const deps = Object.values(packageJSON.dependencies);
|
2018-01-15 02:06:36 +00:00
|
|
|
deps.forEach(depVersion => {
|
|
|
|
nonExactPrefixes.forEach(badPrefix => {
|
|
|
|
expect(depVersion.includes(badPrefix)).toBeFalsy();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
it('devDependencies should not contain any non-exact versions', () => {
|
2018-03-28 19:34:29 +00:00
|
|
|
const deps = Object.values(packageJSON.devDependencies);
|
2018-01-15 02:06:36 +00:00
|
|
|
deps.forEach(depVersion => {
|
|
|
|
nonExactPrefixes.forEach(badPrefix => {
|
|
|
|
expect(depVersion.includes(badPrefix)).toBeFalsy();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|