UNPKG

bonsai-analyzer

Version:
39 lines (35 loc) 949 B
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _defaults = require("../../__test_helpers__/defaults"); var _getChunkModules = _interopRequireDefault(require("../getChunkModules")); const stats = { chunks: [(0, _defaults.defaultChunk)({ id: 0 }), (0, _defaults.defaultChunk)({ id: 1 })], modules: [(0, _defaults.defaultExtendedModule)({ id: 1, chunks: [0] }), (0, _defaults.defaultExtendedModule)({ id: 2, chunks: [0, 1] }), (0, _defaults.defaultExtendedModule)({ id: 2, chunks: [1] })] }; describe('getChunkModules', () => { it('should extend all the modules', () => { const modules = (0, _getChunkModules.default)(stats, [{ id: 1, ids: [1], name: '', names: [], children: [] }]); expect(modules).not.toBeNull(); expect(modules).toHaveLength(2); expect(modules).toMatchSnapshot(); }); });