-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8308fe3
commit 96506d1
Showing
3 changed files
with
20 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
const yt = require('../src/index'); | ||
const ChildProcess = require('child_process').ChildProcess | ||
let execa = require('execa'); | ||
const ChildProcess = require('child_process').ChildProcess; | ||
|
||
describe('createYtDlpAsProcess', () => { | ||
|
||
test('should throw error if URL is missing', () => { | ||
expect(() => yt.createYtDlpAsProcess()).toThrow('Media URL has not been provided!'); | ||
}); | ||
|
||
test('should return an object on completion', async () => { | ||
const result = await yt.createYtDlpAsProcess('test', {h:true}); | ||
|
||
expect(result).toBeInstanceOf(Object); | ||
|
||
expect(async () => await yt.createYtDlpAsProcess('test', {h:true})).toBeInstanceOf(Object); | ||
}); | ||
|
||
test('should return a child process when invoked', async () => { | ||
const result = yt.createYtDlpAsProcess('test', {h:true}); | ||
|
||
expect(result).toBeInstanceOf(ChildProcess); | ||
const process = yt.createYtDlpAsProcess('test', {h:true}); | ||
|
||
await result; | ||
expect(process).toBeInstanceOf(ChildProcess); | ||
expect(async () => await process).toBeTruthy(); | ||
}); | ||
}) |