mirror of
https://github.com/Wan-Video/Wan2.1.git
synced 2025-07-14 11:40:10 +00:00
28 lines
618 B
CoffeeScript
28 lines
618 B
CoffeeScript
|
|
Queue = require('../source/queue')
|
|
Methods = require('../source/methods')
|
|
Core = require('../source/core')
|
|
Promise = require('bluebird')
|
|
|
|
describe 'Queue', ->
|
|
|
|
it 'should queue some songs', ->
|
|
|
|
queue = new Queue 5, (item) ->
|
|
Promise.delay(Math.random() * 5000)
|
|
|
|
queue.add(['a', 'b', 'c', 'd', 'e', 'f', 'g'])
|
|
queue.add([1, 2, 3, 4, 5, 6, 7])
|
|
|
|
queue.start()
|
|
|
|
queue.add(['x', 'y', 'z'])
|
|
|
|
core = new Core()
|
|
methods = new Methods(core)
|
|
|
|
queue = new Queue(5, methods.getSongStream)
|
|
SongList= methods.getPlaylistSongs('playlistid')
|
|
queue.add(SongList)
|
|
queue.start()
|