mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +01:00
chore: run format
This commit is contained in:
@@ -343,7 +343,10 @@ describe('State transitions', () => {
|
||||
// Run through a few packet cycles
|
||||
for (let index = 1; index <= 5; index++) {
|
||||
expect(player.state.status).toEqual(AudioPlayerStatus.Playing);
|
||||
if (player.state.status !== AudioPlayerStatus.Playing) throw new Error('Error');
|
||||
if (player.state.status !== AudioPlayerStatus.Playing) {
|
||||
throw new Error('Error');
|
||||
}
|
||||
|
||||
expect(player.state.playbackDuration).toStrictEqual((index - 1) * 20);
|
||||
expect(player.state.missedFrames).toEqual(index - 1);
|
||||
player['_stepDispatch']();
|
||||
|
||||
@@ -79,7 +79,9 @@ describe('demuxProbe', () => {
|
||||
test('Detects WebM', async () => {
|
||||
const stream = Readable.from(gen(10), { objectMode: false });
|
||||
webmWrite.mockImplementation(function mock(data: Buffer) {
|
||||
if (data[0] === 5) this.emit('head', validHead);
|
||||
if (data[0] === 5) {
|
||||
this.emit('head', validHead);
|
||||
}
|
||||
} as any);
|
||||
const probe = await demuxProbe(stream);
|
||||
expect(probe.type).toEqual(StreamType.WebmOpus);
|
||||
@@ -89,7 +91,9 @@ describe('demuxProbe', () => {
|
||||
test('Detects Ogg', async () => {
|
||||
const stream = Readable.from(gen(10), { objectMode: false });
|
||||
oggWrite.mockImplementation(function mock(data: Buffer) {
|
||||
if (data[0] === 5) this.emit('head', validHead);
|
||||
if (data[0] === 5) {
|
||||
this.emit('head', validHead);
|
||||
}
|
||||
} as any);
|
||||
const probe = await demuxProbe(stream);
|
||||
expect(probe.type).toEqual(StreamType.OggOpus);
|
||||
@@ -99,7 +103,9 @@ describe('demuxProbe', () => {
|
||||
test('Rejects invalid OpusHead', async () => {
|
||||
const stream = Readable.from(gen(10), { objectMode: false });
|
||||
oggWrite.mockImplementation(function mock(data: Buffer) {
|
||||
if (data[0] === 5) this.emit('head', invalidHead);
|
||||
if (data[0] === 5) {
|
||||
this.emit('head', invalidHead);
|
||||
}
|
||||
} as any);
|
||||
const probe = await demuxProbe(stream);
|
||||
expect(probe.type).toEqual(StreamType.Arbitrary);
|
||||
|
||||
Reference in New Issue
Block a user