mirror of
https://github.com/LukeHagar/plex-api-oauth.git
synced 2025-12-06 04:20:40 +00:00
Updating Tests
This commit is contained in:
@@ -1,8 +1,15 @@
|
|||||||
{
|
{
|
||||||
"name": "plex-api-oauth",
|
"name": "plex-api-oauth",
|
||||||
"version": "1.2.6",
|
"version": "1.2.7",
|
||||||
"description": "An NPM Module designed to make Plex Media Server and plex.tv API calls easier to implement in JavaScript and React projects",
|
"description": "An NPM Module designed to make Plex Media Server and plex.tv API calls easier to implement in JavaScript and React projects",
|
||||||
"main": "./src/index.js",
|
"main": "./src/index.js",
|
||||||
|
"keywords": [
|
||||||
|
"plex",
|
||||||
|
"plex-api",
|
||||||
|
"OAuth",
|
||||||
|
"Plex",
|
||||||
|
"API"
|
||||||
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "mocha ./test/index.test.js"
|
"test": "mocha ./test/index.test.js"
|
||||||
|
|||||||
@@ -4,21 +4,29 @@ import {
|
|||||||
PlexLogin,
|
PlexLogin,
|
||||||
GetPlexUserData,
|
GetPlexUserData,
|
||||||
} from "../src/index.js";
|
} from "../src/index.js";
|
||||||
import React from "React";
|
|
||||||
|
|
||||||
describe("Unit Tests", function () {
|
describe("Unit Tests", function () {
|
||||||
let emptyArray = [];
|
let emptyArray = [];
|
||||||
it("Generate ClientId and Login", async function () {
|
var plexClientInformation;
|
||||||
this.timeout(10000);
|
var plexSession;
|
||||||
let plexSession = await PlexLogin(plexClientInformation);
|
|
||||||
|
before(function (done) {
|
||||||
|
plexClientInformation = CreatePlexClientInformation();
|
||||||
|
plexSession = PlexLogin(plexClientInformation);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("Generate ClientId and Login", async function (done) {
|
||||||
|
this.timeout(3000);
|
||||||
assert.notEqual(plexSession.plexTVAuthToken, null);
|
assert.notEqual(plexSession.plexTVAuthToken, null);
|
||||||
assert.notEqual(plexSession.plexTVAuthToken, undefined);
|
assert.notEqual(plexSession.plexTVAuthToken, undefined);
|
||||||
assert.notEqual(plexSession.plexClientInformation, null);
|
assert.notEqual(plexSession.plexClientInformation, null);
|
||||||
assert.notEqual(plexSession.plexClientInformation, undefined);
|
assert.notEqual(plexSession.plexClientInformation, undefined);
|
||||||
console.log("Client Info and Auth Token");
|
console.log("Client Info and Auth Token");
|
||||||
console.log(plexSession);
|
console.log(plexSession);
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
it("Get Plex User Data", async function () {
|
it("Get Plex User Data", async function (done) {
|
||||||
this.timeout(5000);
|
this.timeout(5000);
|
||||||
let plexSession = await PlexLogin(plexClientInformation);
|
let plexSession = await PlexLogin(plexClientInformation);
|
||||||
let plexTVUserData = await GetPlexUserData(plexSession);
|
let plexTVUserData = await GetPlexUserData(plexSession);
|
||||||
@@ -26,8 +34,9 @@ describe("Unit Tests", function () {
|
|||||||
assert.notEqual(plexTVUserData, null);
|
assert.notEqual(plexTVUserData, null);
|
||||||
console.log("User Data");
|
console.log("User Data");
|
||||||
console.log(plexTVUserData);
|
console.log(plexTVUserData);
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
it("Get Plex Servers", async function () {
|
it("Get Plex Servers", async function (done) {
|
||||||
this.timeout(12000);
|
this.timeout(12000);
|
||||||
let plexSession = await PlexLogin(plexClientInformation);
|
let plexSession = await PlexLogin(plexClientInformation);
|
||||||
let plexTVUserData = await GetPlexUserData(plexSession);
|
let plexTVUserData = await GetPlexUserData(plexSession);
|
||||||
@@ -37,6 +46,7 @@ describe("Unit Tests", function () {
|
|||||||
assert.notEqual(plexServers, undefined);
|
assert.notEqual(plexServers, undefined);
|
||||||
console.log("Plex Servers");
|
console.log("Plex Servers");
|
||||||
console.log(plexServers);
|
console.log(plexServers);
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
// it("Get Plex Libraries", async function () {
|
// it("Get Plex Libraries", async function () {
|
||||||
// this.timeout(10000);
|
// this.timeout(10000);
|
||||||
|
|||||||
Reference in New Issue
Block a user