Skip to content

Commit

Permalink
test(url-utils): Use IDExtratorError class
Browse files Browse the repository at this point in the history
Replaced the expected error to use actual class instead a string representing the class name.
  • Loading branch information
mitsuki31 committed Aug 21, 2024
1 parent ba91120 commit 82094da
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/unittest/url-utils.spec.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import assert from 'node:assert';

import URLUtils from '../../lib/url-utils.js';
import error from '../../lib/error.js';
const { IDExtractorError } = error;

describe('module:url-utils', function () {
describe('.URLUtils', function () {
Expand Down Expand Up @@ -53,7 +55,7 @@ describe('module:url-utils', function () {

it(testMessages.extractVideoId[2], function () {
assert.throws(() =>
URLUtils.extractVideoId('https://youtu.be/watch?v=abc'), 'IDExtractorError');
URLUtils.extractVideoId('https://youtu.be/watch?v=abc'), IDExtractorError);
});

it(testMessages.extractVideoId[3], function () {
Expand Down

0 comments on commit 82094da

Please sign in to comment.