2017-05-03 17:48:23 +00:00
|
|
|
import * as globalPackage from '../../package.json';
|
2018-06-25 17:42:50 +00:00
|
|
|
import { globalBeforeEach } from '../__jest__/before-each';
|
2017-05-03 17:48:23 +00:00
|
|
|
|
|
|
|
describe('package.json', () => {
|
2017-07-20 03:36:44 +00:00
|
|
|
beforeEach(globalBeforeEach);
|
2021-05-12 06:35:00 +00:00
|
|
|
|
2017-11-26 20:45:40 +00:00
|
|
|
it('all packed dependencies should exist', () => {
|
|
|
|
for (const name of globalPackage.packedDependencies) {
|
|
|
|
const version = globalPackage.dependencies[name];
|
|
|
|
expect(version).toBeDefined();
|
2017-05-03 17:48:23 +00:00
|
|
|
}
|
|
|
|
});
|
2017-11-08 13:59:14 +00:00
|
|
|
|
2017-11-30 11:21:42 +00:00
|
|
|
it('packages must be included in webpack build or else errors happen', () => {
|
|
|
|
// If this is built by Webpack it fails on multipart/form-data
|
2019-04-26 04:44:53 +00:00
|
|
|
expect(globalPackage.packedDependencies.includes('httpsnippet')).toBe(false);
|
2017-11-30 11:21:42 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('packages must NOT be included in webpack build or else errors happen', () => {
|
|
|
|
// PDFJS breaks if not part of Webpack build
|
|
|
|
expect(globalPackage.packedDependencies.includes('pdfjs-dist')).toBe(true);
|
|
|
|
});
|
2017-05-03 17:48:23 +00:00
|
|
|
});
|