jasmine-core
Version:
Simple JavaScript testing framework for browsers and node.js
23 lines (18 loc) • 357 B
JavaScript
class Player {
play(song) {
this.currentlyPlayingSong = song;
this.isPlaying = true;
}
pause() {
this.isPlaying = false;
}
resume() {
if (this.isPlaying) {
throw new Error('song is already playing');
}
this.isPlaying = true;
}
makeFavorite() {
this.currentlyPlayingSong.persistFavoriteStatus(true);
}
}