Skip to content

davidholyko/audio-test-harness

Repository files navigation

Audio Test Harness

Purpose

This repo exists to help figure out how to test audio in a browser in a node environment

Setup

nvm use
npm ci
npm run build

Development

npm run dev

Tests

We have different levels of test cases based on their complexity.

# run all tests
npm run test

# run a single test
npm run test test/__integration_tests__/01-level-02-single-audio-plays-to-end.test.ts

Test Cases [Level 1]

These test cases check very basic functionality against Howler + HowlerMock

  1. Check that Audio can load
  2. Check that Audio can play until natural end
  3. Check that Audio can resume after pause
  4. Check that Audio can pause
  5. Check that Audio can stop

Test Cases [Level 2]

These test cases check that the Audio Test Harness can handle more complicated logic around sequences

  1. Check audio can play after a small delay after loading
  2. Check audio can resume after a small delay after pausing

Test Cases [Level 3]

These test cases check that the Audio Test Harness can handle multiple streams

  1. Check that multiple audios can play, pause, stop, end together

Test Cases [Level 4]

These test cases check that the Audio Test Harness can business rules applied to audio

  1. Check that maximum of two audios can be played at once
  2. Check that audio can stop another audio

About

A small repo to demonstrate how to test audio in the browser from a node based test harness

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages