1
mirror of https://github.com/jakejarvis/careful-downloader.git synced 2026-01-14 06:42:56 -05:00

add test for zero options passed in

This commit is contained in:
2021-10-09 09:22:39 -04:00
parent 1ac5a48727
commit 349258df92
4 changed files with 109 additions and 77 deletions

View File

@@ -61,3 +61,17 @@ it("destDir located outside of module, throw error", async function () {
},
)).to.throw;
});
it("zero options, download zip and leave it alone", async function () {
this.timeout(30000); // increase timeout to an excessive 30 seconds for CI
await downloader(
"https://github.com/gohugoio/hugo/releases/download/v0.88.1/hugo_extended_0.88.1_Windows-64bit.zip",
"https://github.com/gohugoio/hugo/releases/download/v0.88.1/hugo_0.88.1_checksums.txt",
);
expect(fs.existsSync(path.join(__dirname, "../downloads", "hugo_extended_0.88.1_Windows-64bit.zip"))).to.be.true;
// clean up
fs.removeSync(path.join(__dirname, "../downloads"));
});