mirror of
https://github.com/navidrome/navidrome.git
synced 2026-05-03 06:51:16 +00:00
fix: test
This commit is contained in:
parent
a82a03feda
commit
f54229ea50
@ -14,7 +14,7 @@ describe('usePreloading', () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks()
|
||||
// Mock Audio constructor
|
||||
global.Audio = vi.fn().mockImplementation(function() {
|
||||
global.Audio = vi.fn().mockImplementation(function () {
|
||||
this.src = ''
|
||||
this.addEventListener = vi.fn()
|
||||
})
|
||||
@ -119,7 +119,7 @@ describe('usePreloading', () => {
|
||||
it('should handle audio load errors gracefully', () => {
|
||||
const consoleSpy = vi.spyOn(console, 'error').mockImplementation(() => {})
|
||||
|
||||
global.Audio = vi.fn().mockImplementation(function() {
|
||||
global.Audio = vi.fn().mockImplementation(function () {
|
||||
this.src = ''
|
||||
this.addEventListener = vi.fn((event, callback) => {
|
||||
if (event === 'error') {
|
||||
|
||||
@ -16,7 +16,7 @@ describe('useReplayGain', () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks()
|
||||
// Mock Web Audio API
|
||||
global.AudioContext = vi.fn().mockImplementation(function() {
|
||||
global.AudioContext = vi.fn().mockImplementation(function () {
|
||||
this.createMediaElementSource = vi.fn(() => ({
|
||||
connect: vi.fn(),
|
||||
}))
|
||||
@ -85,7 +85,7 @@ describe('useReplayGain', () => {
|
||||
const consoleSpy = vi.spyOn(console, 'error').mockImplementation(() => {})
|
||||
|
||||
// Mock AudioContext to throw error
|
||||
global.AudioContext = vi.fn().mockImplementation(function() {
|
||||
global.AudioContext = vi.fn().mockImplementation(function () {
|
||||
throw new Error('Web Audio API not supported')
|
||||
})
|
||||
|
||||
@ -125,7 +125,7 @@ describe('useReplayGain', () => {
|
||||
connect: vi.fn(),
|
||||
}
|
||||
|
||||
global.AudioContext = vi.fn().mockImplementation(function() {
|
||||
global.AudioContext = vi.fn().mockImplementation(function () {
|
||||
this.createMediaElementSource = vi.fn(() => ({
|
||||
connect: vi.fn(),
|
||||
}))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user