MyCrypto/spec/package.json.spec.ts
Daniel Ternyak c9676cac62
Deterministic Webpack 4 (#1445)
* (Reapplied) Upgrade to Webpack 4

* remove yarn.lock from gitignore

* add yarn.lock

* custom hashing for css and client bundle filenames

* add hash-files dep

* update deps

* add .wwp-cache to .gitignore

* use latest git hash as filename hash

* remove unused hash-files dep

* update favicon plugin

* remove yarn.lock
2018-04-05 15:53:36 -05:00

28 lines
879 B
TypeScript

import packageJSON from '../package.json';
interface Dependencies {
[key: string]: string;
}
// 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 as 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 as Dependencies);
deps.forEach(depVersion => {
nonExactPrefixes.forEach(badPrefix => {
expect(depVersion.includes(badPrefix)).toBeFalsy();
});
});
});
});