Update test

This commit is contained in:
Hexah 2020-03-06 23:17:34 +01:00
parent 588ee1e271
commit 617db63d9b
1 changed files with 9 additions and 8 deletions

View File

@ -32,14 +32,15 @@ void main() {
test('Get video media stream with invalid id', () async {
var yt = YoutubeExplode();
var stream = yt.getVideoMediaStream('aaa').asStream();
stream.listen(neverCalled)
..onError(expectAsync1((error) {
expect(error, isArgumentError);
}))
..onDone(() {
yt.close();
});
try {
await yt.getVideoMediaStream('aaa');
neverCalled();
// ignore: avoid_catches_without_on_clauses
} catch (e) {
expect(e, isArgumentError);
} finally {
yt.close();
}
});
// TODO: Implement more tests