Skip to content

Commit ef40090

Browse files
committed
Add assert
1 parent 179dbb4 commit ef40090

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed

tests/libs/actions.install.test.ts

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,36 @@ describe("InstallAction", () => {
428428
stderr: "piped",
429429
}],
430430
});
431+
const dimJson = JSON.parse(Deno.readTextFileSync("dim.json"));
432+
assertEquals(dimJson, {
433+
fileVersion: "1.1",
434+
contents: [{
435+
catalogResourceId: null,
436+
catalogUrl: null,
437+
headers: {},
438+
name: "unzip",
439+
postProcesses: ["unzip"],
440+
url: "https://example.com/dummy.zip",
441+
}],
442+
});
443+
444+
const dimLockJson = JSON.parse(Deno.readTextFileSync("dim-lock.json"));
445+
assertEquals(dimLockJson, {
446+
lockFileVersion: "1.1",
447+
contents: [{
448+
catalogResourceId: null,
449+
catalogUrl: null,
450+
eTag: null,
451+
headers: {},
452+
integrity: "",
453+
lastDownloaded: "2022-01-02T03:04:05.678Z",
454+
lastModified: null,
455+
name: "unzip",
456+
path: "./data_files/unzip/dummy.zip",
457+
postProcesses: ["unzip"],
458+
url: "https://example.com/dummy.zip",
459+
}],
460+
});
431461
} finally {
432462
denoRunStub.restore();
433463
kyGetStub.restore();
@@ -490,6 +520,36 @@ describe("InstallAction", () => {
490520
);
491521
assertEquals(testData, "a,b\nc,d\ne,f\n");
492522
assertSpyCall(consoleLogStub, 0, { args: ["Convert xlsx to csv."] });
523+
const dimJson = JSON.parse(Deno.readTextFileSync("dim.json"));
524+
assertEquals(dimJson, {
525+
fileVersion: "1.1",
526+
contents: [{
527+
catalogResourceId: null,
528+
catalogUrl: null,
529+
headers: {},
530+
name: "xlsx-to-csv",
531+
postProcesses: ["xlsx-to-csv"],
532+
url: "https://example.com/dummy.xlsx",
533+
}],
534+
});
535+
536+
const dimLockJson = JSON.parse(Deno.readTextFileSync("dim-lock.json"));
537+
assertEquals(dimLockJson, {
538+
lockFileVersion: "1.1",
539+
contents: [{
540+
catalogResourceId: null,
541+
catalogUrl: null,
542+
eTag: null,
543+
headers: {},
544+
integrity: "",
545+
lastDownloaded: "2022-01-02T03:04:05.678Z",
546+
lastModified: null,
547+
name: "xlsx-to-csv",
548+
path: "./data_files/xlsx-to-csv/dummy.xlsx",
549+
postProcesses: ["xlsx-to-csv"],
550+
url: "https://example.com/dummy.xlsx",
551+
}],
552+
});
493553
} finally {
494554
kyGetStub.restore();
495555
}
@@ -543,6 +603,37 @@ describe("InstallAction", () => {
543603
"./data_files/cmdecho/dummy.txt",
544604
],
545605
});
606+
607+
const dimJson = JSON.parse(Deno.readTextFileSync("dim.json"));
608+
assertEquals(dimJson, {
609+
fileVersion: "1.1",
610+
contents: [{
611+
catalogResourceId: null,
612+
catalogUrl: null,
613+
headers: {},
614+
name: "cmdecho",
615+
postProcesses: ["cmd echo"],
616+
url: "https://example.com/dummy.txt",
617+
}],
618+
});
619+
620+
const dimLockJson = JSON.parse(Deno.readTextFileSync("dim-lock.json"));
621+
assertEquals(dimLockJson, {
622+
lockFileVersion: "1.1",
623+
contents: [{
624+
catalogResourceId: null,
625+
catalogUrl: null,
626+
eTag: null,
627+
headers: {},
628+
integrity: "",
629+
lastDownloaded: "2022-01-02T03:04:05.678Z",
630+
lastModified: null,
631+
name: "cmdecho",
632+
path: "./data_files/cmdecho/dummy.txt",
633+
postProcesses: ["cmd echo"],
634+
url: "https://example.com/dummy.txt",
635+
}],
636+
});
546637
} finally {
547638
kyGetStub.restore();
548639
denoRunStub.restore();

0 commit comments

Comments
 (0)