mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-22 09:37:17 +00:00
Assert which files get read from the zip
This commit is contained in:
parent
ab6c1264fd
commit
8529d948ec
1 changed files with 19 additions and 0 deletions
|
|
@ -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,
|
||||
]
|
||||
`);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue