12 lines
402 B
JavaScript
12 lines
402 B
JavaScript
const download = require('./download.js');
|
|
const fsp = require('fs/promises');
|
|
|
|
describe('download', function () {
|
|
it('should download a file from url', async function () {
|
|
const testFilePath = '/tmp/pmel.jpg'
|
|
try {
|
|
await fsp.unlink(testFilePath)
|
|
} catch (e) {}
|
|
await download('https://futureporn-b2.b-cdn.net/projekt-melody.jpg', testFilePath)
|
|
})
|
|
}) |