Ensure package versions are exact (#824)

This commit is contained in:
Daniel Ternyak 2018-01-14 20:06:36 -06:00 committed by GitHub
parent c13610eeba
commit 7097a44f32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 0 deletions

23
spec/package.json.spec.ts Normal file
View File

@ -0,0 +1,23 @@
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', () => {
const deps = Object.values(packageJSON.dependencies);
deps.forEach(depVersion => {
nonExactPrefixes.forEach(badPrefix => {
expect(depVersion.includes(badPrefix)).toBeFalsy();
});
});
});
it('devDependencies should not contain any non-exact versions', () => {
const deps = Object.values(packageJSON.devDependencies);
deps.forEach(depVersion => {
nonExactPrefixes.forEach(badPrefix => {
expect(depVersion.includes(badPrefix)).toBeFalsy();
});
});
});
});