Closed nobody4t closed 5 years ago
This request should spend 20s. But in the spec, it just returns after 0.04s.
This is my test code.
it("Test download connection file.", async() => {
if (!url) {
fail("Please specify your url.");
}
expect(utils.downloadConnectionFile).toBeDefined();
let opts = {url:url, key:"Ppp", secret:"kAjqE_hrW7oruc8U8BYCY9ceUaMrNFnbJ4qzIufCLZAKkBHXfcS"};
await utils.downloadConnectionFile(opts, conFile);
let result = fs.existsSync(conFile);
expect(result).toBe(true);
});
This is the cause I misused the createWriteStream. Sorry.
I try to test a function which includes the snippet as following. But This got never executed. I tried with asynchronous and timeout. But none is available. But I can execute it from a script. Not sure what is going here.