add tests

This commit is contained in:
hazycora
2024-07-30 18:32:21 -04:00
parent c83ecda85a
commit 157b807d9b
11 changed files with 270 additions and 4 deletions

View File

@@ -53,7 +53,20 @@ interface APIMethod {
export default class Deezer implements StreamerWithLogin {
hostnames = ['deezer.com', 'www.deezer.com', 'deezer.page.link']
testData = {
'https://www.deezer.com/us/artist/1194083': {
type: 'artist',
title: 'Tyler, The Creator'
},
'https://www.deezer.com/us/track/559711712': {
type: 'track',
title: 'Potato Salad'
},
'https://www.deezer.com/us/album/97140952': {
type: 'album',
title: 'IGOR'
}
} as const
headers: { [header: string]: string } = {
Accept: '*/*',
'User-Agent':

View File

@@ -52,6 +52,16 @@ interface LoginResponse {
export default class Qobuz implements StreamerWithLogin {
hostnames = ['play.qobuz.com', 'open.qobuz.com', 'www.qobuz.com', 'qobuz.com']
testData = {
'https://www.qobuz.com/us-en/interpreter/tyler-the-creator/589771': {
title: 'Tyler, The Creator',
type: 'artist'
},
'https://www.qobuz.com/us-en/album/igor-tyler-the-creator/qtz65tw2of0ha': {
title: 'IGOR',
type: 'album'
}
} as const
token?: string
appSecret: string
appId: string

View File

@@ -45,6 +45,16 @@ interface SoundcloudTranscoding {
export default class Soundcloud implements Streamer {
hostnames = ['soundcloud.com', 'm.soundcloud.com', 'www.soundcloud.com']
testData = {
'https://soundcloud.com/saoirsedream/charlikartlanparty': {
type: 'track',
title: 'Charli Kart LAN Party'
},
'https://soundcloud.com/saoirsedream/sets/star': {
type: 'album',
title: 'star★☆'
}
} as const
oauthToken?: string
client?: ScClient
constructor(options: SoundcloudOptions) {

View File

@@ -11,6 +11,21 @@ import {
class Spotify implements StreamerWithLogin {
client: Librespot
hostnames = ['open.spotify.com']
testData = {
'https://open.spotify.com/track/1jzIJcHCXneHw7ojC6LXiF': {
type: 'track',
title: 'Potato Salad'
},
'https://open.spotify.com/album/5zi7WsKlIiUXv09tbGLKsE': {
type: 'album',
title: 'IGOR'
},
'https://open.spotify.com/artist/4V8LLVI7PbaPR0K2TGSxFF': {
type: 'artist',
title: 'Tyler, The Creator'
}
} as const
constructor(options: LibrespotOptions) {
this.client = new Librespot(options)
}

View File

@@ -70,6 +70,20 @@ export default class Tidal implements Streamer {
countryCode: string
userId: number | undefined
hostnames = ['tidal.com', 'www.tidal.com', 'listen.tidal.com']
testData = {
'https://tidal.com/browse/artist/3908662': {
type: 'artist',
title: 'Tyler, The Creator'
},
'https://tidal.com/browse/album/109485854': {
type: 'album',
title: 'IGOR'
},
'https://tidal.com/browse/track/95691774': {
type: 'track',
title: 'Potato Salad'
}
} as const
failedAuth = false
constructor(options: TidalOptions) {
this.tvToken = options.tvToken