-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed bigint fields to string + Added null filtering
- Loading branch information
1 parent
8520fab
commit d4a2c65
Showing
11 changed files
with
79 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { | ||
YtMusicSong, | ||
YtMusicVideo, | ||
YtMusicAlbum, | ||
YtMusicPlaylist, | ||
YtMusicArtist | ||
} from "./interfaces"; | ||
|
||
export const songs = (item: YtMusicSong) => !!item.id && !!item.title; | ||
export const videos = (item: YtMusicVideo) => !!item.id && !!item.title; | ||
export const albums = (item: YtMusicAlbum) => !!item.id && !!item.browseId && !!item.title; | ||
export const playlists = (item: YtMusicPlaylist) => !!item.id && !!item.browseId && !!item.title; | ||
export const artists = (item: YtMusicArtist) => !!item.id && !!item.name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { retrieveSuggestions } from "../src"; | ||
|
||
it("returns suggested playlists with all data correctly", () => ( | ||
it("returns suggested playlists correctly", () => ( | ||
retrieveSuggestions() | ||
.then(suggestions => expect(suggestions).not.toBeNull()) | ||
.then(suggestions => expect(suggestions).not.toStrictEqual([])) | ||
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
export const expectFromQueries = ( | ||
export const expectFromQueries = <T>( | ||
queries: string[], | ||
callback: (text: string) => Promise<any> | ||
runCb: (text: string) => Promise<T>, | ||
expectCb: (result: T) => any | ||
): Promise<void> => ( | ||
Promise.all(queries.map(callback)) | ||
Promise.all(queries.map(runCb)) | ||
.then(results => | ||
results.forEach(result => | ||
expect(result).not.toBeNull() | ||
) | ||
results.forEach(expectCb) | ||
) | ||
); | ||
|
||
export const expectFromWrong = async ( | ||
callback: (text: string) => Promise<any> | ||
callback: (text: string) => Promise<any>, | ||
errValue: any = null | ||
): Promise<void> => ( | ||
callback("ad463b3c3298f77dd6d21c95020feb45baf98d7a") | ||
.then(result => expect(result).toBeNull()) | ||
.then(result => expect(result).toStrictEqual(errValue)) | ||
); |