Skip to content

Conversation

@FirstLemon
Copy link
Collaborator

Includes unit tests for some of the bass module methods

Bass

  • PlayFile()
  • PlayUrl()

IGModAudioChannel

  • __index()
  • __newindex
  • __tostring()
  • Destroy()
  • GetTable()
  • Pause()
  • Play()
  • SetVolume()
  • Stop()

expect( channel:GetState() ).to.equal( 1 )
end)

done()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, in here do not use more timers & if you do, do not call done() before all of them finished, also I am like 99% sure these could have random behavior since the timers will all run the same tick.

name = "Function is nil when module disabled",
when = not HolyLib_IsModuleEnabled( "bass" ),
func = function()
expect( bass.PlayFile ).to.beA( "nil" )
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will error since the table bass will be nil, you can just do expect( bass )

channel:Play()
expect( channel:GetState() ).to.equal( 1 )

done()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as further below, please do not call done before its actually done, the timers still aren't done. Also please do not use timers at all unless they are nessesary.

expect( channel:GetState() ).to.equal( 0 )
end)

done()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same again, please do not mark it as done & why the timer

@RaphaelIT7 RaphaelIT7 force-pushed the main branch 4 times, most recently from 3c6136a to d279f42 Compare October 28, 2025 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants