-
-
Couldn't load subscription status.
- Fork 17
Adding some bass module tests #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| expect( channel:GetState() ).to.equal( 1 ) | ||
| end) | ||
|
|
||
| done() |
There was a problem hiding this comment.
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" ) |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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
3c6136a to
d279f42
Compare
Includes unit tests for some of the bass module methods
Bass
PlayFile()PlayUrl()IGModAudioChannel
__index()__newindex__tostring()Destroy()GetTable()Pause()Play()SetVolume()Stop()