From bda1bc442c0fc84aacc1561ec3a31d0d67a0a003 Mon Sep 17 00:00:00 2001 From: Vesa Laakso Date: Sun, 4 Feb 2018 14:08:56 +0200 Subject: [PATCH] Improve error message when webpack-configs test fails The "toContainSubset" assertion is terrible when the error is in values missing from the target object. I wasted so much time in deciphering a build failure because of that... --- packages/plugin/test/webpack-configs.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/plugin/test/webpack-configs.js b/packages/plugin/test/webpack-configs.js index 50693635..da386df4 100644 --- a/packages/plugin/test/webpack-configs.js +++ b/packages/plugin/test/webpack-configs.js @@ -88,7 +88,12 @@ async function expectValidReport(opts) { expect(fs.existsSync(`${__dirname}/output/${bundleFilename}`)).to.be.true; expect(fs.existsSync(`${__dirname}/output/${reportFilename}`)).to.be.true; const chartData = await getChartDataFromReport(reportFilename); - expect(chartData[0]).to.containSubset({ + expect({ + label: chartData[0].label, + statSize: chartData[0].statSize, + parsedSize: chartData[0].parsedSize, + gzipSize: chartData[0].gzipSize + }).to.equal({ label: bundleLabel, statSize, parsedSize,