From 8529d948ecc577e034430b4361013caf2e077855 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Sat, 20 Jul 2019 10:39:45 -0700 Subject: [PATCH] Assert which files get read from the zip --- experiments/modern/src/utils.test.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/experiments/modern/src/utils.test.js b/experiments/modern/src/utils.test.js index 18a572a5..62109908 100644 --- a/experiments/modern/src/utils.test.js +++ b/experiments/modern/src/utils.test.js @@ -60,9 +60,28 @@ describe("asyncTreeMap", () => { describe("inlineIncludes", () => { it("inlines the contents of included files as children of the include node", async () => { const zip = await getSkinZip(); + const originalFile = zip.file; + zip.file = jest.fn(path => originalFile.call(zip, path)); + const xml = await Utils.readXml(zip, "SkIn.XmL"); const resolvedXml = await Utils.inlineIncludes(xml, zip); expect(resolvedXml).toMatchSnapshot(); + expect(zip.file.mock.calls.map(args => args[0])).toMatchInlineSnapshot(` + Array [ + /SkIn\\.XmL/i, + /xml\\\\/system-colors\\.xml/i, + /xml\\\\/standardframe\\.xml/i, + /xml\\\\/player\\.xml/i, + /xml\\\\/pledit\\.xml/i, + /xml\\\\/video\\.xml/i, + /xml\\\\/eq\\.xml/i, + /xml\\\\/color-presets\\.xml/i, + /xml\\\\/color-themes\\.xml/i, + /studio-elements\\.xml/i, + /player-elements\\.xml/i, + /player-normal\\.xml/i, + ] + `); }); });