Switching computers

This commit is contained in:
luke-hagar-sp
2022-07-27 20:30:54 -05:00
parent 7a189afbb4
commit 566c9b64ff
3 changed files with 421 additions and 41 deletions

View File

@@ -1,31 +1,31 @@
import { PlexAPIOAuth } from "../src/index.js";
import { strict as assert } from "assert";
describe("Login Test", function () {
describe("Unit Tests", function () {
let PlexSession = new PlexAPIOAuth();
let emptyArray = [];
it("Generate ClientId", function () {
PlexSession.GenerateClientId();
assert.notEqual(PlexSession.clientId, null);
assert.notEqual(PlexSession.clientId, undefined);
console.log("Plex Session");
console.log(PlexSession);
// console.log("Plex Session");
// console.log(PlexSession);
});
it("Login", async function () {
this.timeout(10000);
let response = await PlexSession.PlexLogin();
assert.notEqual(PlexSession.plexTVAuthToken, undefined);
assert.notEqual(response, undefined);
console.log("Auth Token");
console.log(PlexSession.plexTVAuthToken);
// console.log("Auth Token");
// console.log(PlexSession.plexTVAuthToken);
});
it("Get Plex User Data", async function () {
this.timeout(5000);
let response = await PlexSession.GetPlexUserData();
assert.notEqual(PlexSession.plexTVUserData, undefined);
assert.notEqual(response, undefined);
console.log("User Data");
console.log(PlexSession.plexTVUserData);
// console.log("User Data");
// console.log(PlexSession.plexTVUserData);
});
it("Get Plex Servers", async function () {
this.timeout(10000);
@@ -35,8 +35,8 @@ describe("Login Test", function () {
assert.notEqual(PlexSession.plexServers, undefined);
assert.notEqual(PlexSession.plexDevices, emptyArray);
assert.notEqual(response, null);
console.log("Plex Servers");
console.log(PlexSession.plexServers);
// console.log("Plex Servers");
// console.log(PlexSession.plexServers);
});
it("Get Plex Libraries", async function () {
this.timeout(10000);
@@ -53,7 +53,51 @@ describe("Login Test", function () {
assert.notEqual(PlexSession.plexTVShowLibraries, null);
assert.notEqual(PlexSession.plexTVShowLibraries, undefined);
assert.notEqual(PlexSession.plexTVShowLibraries, emptyArray);
console.log("Plex Libraries");
console.log(PlexSession.plexLibraries);
// console.log("Plex Libraries");
// console.log(PlexSession.plexLibraries);
});
// it("Get Plex Movie Library Contents", async function () {
// this.timeout(10000);
// let response = await PlexSession.GetPlexMovieLibraryContent();
// assert.notEqual(PlexSession.plexMovieLibraryContent, null);
// assert.notEqual(PlexSession.plexMovieLibraryContent, undefined);
// assert.notEqual(PlexSession.plexMovieLibraryContent, emptyArray);
// // console.log("Plex Movie Library Content");
// // console.log(PlexSession.plexMovieLibraryContent);
// });
// it("Get Plex Music Library Contents", async function () {
// this.timeout(10000);
// let response = await PlexSession.GetPlexMusicLibraryContent();
// assert.notEqual(PlexSession.plexArtistLibraries, null);
// assert.notEqual(PlexSession.plexArtistLibraries, undefined);
// assert.notEqual(PlexSession.plexArtistLibraries, emptyArray);
// assert.notEqual(PlexSession.plexAlbumLibraries, null);
// assert.notEqual(PlexSession.plexAlbumLibraries, undefined);
// assert.notEqual(PlexSession.plexAlbumLibraries, emptyArray);
// assert.notEqual(PlexSession.plexSongLibraries, null);
// assert.notEqual(PlexSession.plexSongLibraries, undefined);
// assert.notEqual(PlexSession.plexSongLibraries, emptyArray);
// // console.log("Plex Library Content");
// // console.log(PlexSession.plexAlbumLibraries);
// });
// it("Get Plex TV Library Contents", async function () {
// this.timeout(30000);
// let response = await PlexSession.GetPlexTVShowLibraryContent();
// assert.notEqual(PlexSession.plexTVShowLibraryContent, null);
// assert.notEqual(PlexSession.plexTVShowLibraryContent, undefined);
// assert.notEqual(PlexSession.plexTVShowLibraryContent, emptyArray);
// assert.notEqual(PlexSession.plexSeasonLibraries, null);
// assert.notEqual(PlexSession.plexSeasonLibraries, undefined);
// assert.notEqual(PlexSession.plexSeasonLibraries, emptyArray);
// assert.notEqual(PlexSession.episodeLibraryContent, null);
// assert.notEqual(PlexSession.episodeLibraryContent, undefined);
// assert.notEqual(PlexSession.episodeLibraryContent, emptyArray);
// //console.log("Plex TV Library Content");
// //console.log(PlexSession.plexSeasonLibraries);
// });
it("Get Plex TV Show Seasons - Stateless", async function () {
this.timeout(4000);
let response = await PlexSession.GetPlexTVShowSeasons();
//console.log(response);
});
});