Skip to content

Commit 28747c9

Browse files
committed
Update error thrown by invalid header
1 parent 25dc5f4 commit 28747c9

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

.changeset/public-dingos-travel.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'js-vtt': patch
3+
---
4+
5+
Update error thrown by invalid header

tests/vtt.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { VTT } from '../src/vtt';
33
import { Cue } from '../src/segments/cue';
44
import { Region } from '../src/segments/region';
55
import { Comment } from '../src/segments/comment';
6-
import InvalidHeaderError from '../src/errors/InvalidHeaderError';
6+
import InvalidVttError from '../src/errors/InvalidVttError';
77

88
// ---------------------------------------------------------------------------
99
// Real-world-ish WebVTT fixture strings
@@ -529,12 +529,12 @@ describe('VTT fromString()', () => {
529529
expect(vtt2.toJSON().segments.length).toBe(vtt1.toJSON().segments.length);
530530
});
531531

532-
it('throws InvalidHeaderError for a malformed header', () => {
533-
expect(() => VTT.fromString('NOT A VTT FILE')).toThrow(InvalidHeaderError);
532+
it('throws InvalidVttError for a malformed header', () => {
533+
expect(() => VTT.fromString('NOT A VTT FILE')).toThrow(InvalidVttError);
534534
});
535535

536-
it('throws InvalidHeaderError for an empty string', () => {
537-
expect(() => VTT.fromString('')).toThrow(InvalidHeaderError);
536+
it('throws InvalidVttError for an empty string', () => {
537+
expect(() => VTT.fromString('')).toThrow(InvalidVttError);
538538
});
539539

540540
it('handles a file where cues have no blank line between NOTE and first cue', () => {

0 commit comments

Comments
 (0)