UNPKG

bonsai-analyzer

Version:
30 lines (25 loc) 862 B
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _defaults = require("../../__test_helpers__/defaults"); var _getModulesByChunk = _interopRequireDefault(require("../getModulesByChunk")); 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] })] }; describe('getModulesByChunk', () => { it('should list all the chunks', () => { const result = (0, _getModulesByChunk.default)(stats, stats.chunks.map(chunk => chunk.id)); // Snapshot formatting dies on the whole `result` object. expect(Object.keys(result)).toMatchSnapshot(); expect(result).toMatchSnapshot(); }); });