44import { AccessToken } from 'livekit-server-sdk' ;
55import { randomUUID } from 'node:crypto' ;
66import { setTimeout as delay } from 'node:timers/promises' ;
7- import { afterAll , describe , expect , it } from 'vitest' ;
7+ import { afterAll , describe , expect , it as itRaw } from 'vitest' ;
88import {
99 AudioFrame ,
1010 AudioSource ,
@@ -20,6 +20,9 @@ import {
2020 dispose ,
2121} from '../index.js' ;
2222
23+ // use concurrent testing if available on the runner (currently not supported by bun's api)
24+ const it = typeof itRaw . concurrent === 'function' ? itRaw . concurrent : itRaw ;
25+
2326const hasE2EEnv =
2427 ! ! process . env . LIVEKIT_URL && ! ! process . env . LIVEKIT_API_KEY && ! ! process . env . LIVEKIT_API_SECRET ;
2528const describeE2E = hasE2EEnv ? describe : describe . skip ;
@@ -202,7 +205,7 @@ describeE2E('livekit-rtc e2e', () => {
202205 await dispose ( ) ;
203206 } ) ;
204207
205- it . concurrent (
208+ it (
206209 'connects to a room' ,
207210 async ( ) => {
208211 const { roomName, rooms } = await connectTestRooms ( 1 ) ;
@@ -225,7 +228,7 @@ describeE2E('livekit-rtc e2e', () => {
225228 testTimeoutMs ,
226229 ) ;
227230
228- it . concurrent (
231+ it (
229232 'connects multiple participants to the same room' ,
230233 async ( ) => {
231234 const { roomName, rooms } = await connectTestRooms ( 2 ) ;
@@ -241,7 +244,7 @@ describeE2E('livekit-rtc e2e', () => {
241244 testTimeoutMs ,
242245 ) ;
243246
244- it . concurrent (
247+ it (
245248 'emits participantDisconnected when a participant leaves' ,
246249 async ( ) => {
247250 const { rooms } = await connectTestRooms ( 2 ) ;
@@ -267,7 +270,7 @@ describeE2E('livekit-rtc e2e', () => {
267270 testTimeoutMs ,
268271 ) ;
269272
270- it . concurrent (
273+ it (
271274 'transfers audio between two participants (sine detection)' ,
272275 async ( ) => {
273276 const cases = [
@@ -367,7 +370,7 @@ describeE2E('livekit-rtc e2e', () => {
367370 testTimeoutMs * 2 ,
368371 ) ;
369372
370- it . concurrent (
373+ it (
371374 'publishes and receives reliable data packets' ,
372375 async ( ) => {
373376 const { rooms } = await connectTestRooms ( 2 ) ;
@@ -407,7 +410,7 @@ describeE2E('livekit-rtc e2e', () => {
407410 testTimeoutMs ,
408411 ) ;
409412
410- it . concurrent (
413+ it (
411414 'sends and receives text and byte streams' ,
412415 async ( ) => {
413416 const { rooms } = await connectTestRooms ( 2 ) ;
@@ -469,7 +472,7 @@ describeE2E('livekit-rtc e2e', () => {
469472 testTimeoutMs ,
470473 ) ;
471474
472- it . concurrent (
475+ it (
473476 'invokes RPC methods and returns structured errors' ,
474477 async ( ) => {
475478 const { rooms } = await connectTestRooms ( 2 ) ;
0 commit comments