Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Wifsimster committed Apr 26, 2020
1 parent d9c2266 commit 015ee41
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 47 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
"homepage": "https://github.com/Wifsimster/pavie#readme",
"dependencies": {
"axios": "^0.19.2",
"uuid": "^7.0.2"
"uuid": "^7.0.3"
}
}
22 changes: 14 additions & 8 deletions test/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ const Pavie = require("../pavie")

const pavie = new Pavie(settings)

pavie
.signin()
.then(async () => {
const response = await pavie.getHistory()
main()

async function main() {
await pavie
.signin()
.catch(err => { console.error(err) })

const response = await pavie
.getHistory()
.catch(err => { console.error(err) })

if(response) {
console.log(response)
})
.catch(err => {
console.error(err)
})
}
}
23 changes: 15 additions & 8 deletions test/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ const Pavie = require("../pavie")

const pavie = new Pavie(settings)

pavie
.signin()
.then(async () => {
const response = await pavie.getImage(`/library/metadata/25963/thumb/1557058611?X-Plex-Token=fPHNF2Wkg84qDPprCbqy`)
main()

async function main() {
await pavie
.signin()
.catch(err => { console.error(err) })

const response = await pavie
.getImage(`/library/metadata/25963/thumb/1557058611?X-Plex-Token=fPHNF2Wkg84qDPprCbqy`)
.catch(err => { console.error(err) })

if(response) {
console.log(response)
})
.catch(err => {
console.error(err)
})
}
}

30 changes: 12 additions & 18 deletions test/playlists.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,19 @@ const Pavie = require("../pavie")

const pavie = new Pavie(settings)

// pavie
// .signin()
// .then(async () => {
// const response = await pavie.getPlaylists()
// console.log(response)
// })
// .catch(err => {
// console.error(err)
// })
main()

pavie
.signin()
.then(async () => {
const response = await pavie.addPlaylistFiles({
async function main() {
await pavie
.signin()
.catch(err => { console.error(err) })

const response = await pavie
.addPlaylist({
uri: "server://2c59cf8256eccd8629081638e98e27bf8349c3e7/com.plexapp.plugins.library/library/metadata/8412",
title: "lorem"
})
console.log(response)
})
.catch(err => {
console.error(err)
})
.catch(err => { console.error(err) })

console.log(response)
}
22 changes: 13 additions & 9 deletions test/signin.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ const Pavie = require("../pavie")

const pavie = new Pavie(settings)

pavie
.signin()
.then(async () => {
const response = await pavie.getActions()
console.log(response)
})
.catch(err => {
console.error(err)
})
main()

async function main() {
await pavie
.signin()
.catch(err => { console.error(err) })

const response = await pavie
.getActions()
.catch(err => { console.error(err) })

console.log(response)
}

0 comments on commit 015ee41

Please sign in to comment.