lol-api-client
Version:
A Node client for interfacing with the League of Legends API
42 lines (34 loc) • 916 B
JavaScript
const ChampionMastery = require('../lib/champion-mastery')
require('dotenv').config({ silent: true })
const championMastery = new ChampionMastery(process.env['RIOT_API_KEY'], 'NA1', 'na')
const playerId = 24850474
const championId = 57
exports.getByPlayerAndChampion = function (test) {
championMastery.getByPlayerAndChampion(playerId, championId)
.then((data) => {
test.equal(data.playerId, playerId)
test.done()
})
}
exports.getAllByPlayer = function (test) {
championMastery.getAllByPlayer(playerId)
.then((data) => {
test.ok(data)
test.done()
})
}
exports.getScore = function (test) {
championMastery.getScore(playerId)
.then((data) => {
test.ok(data)
test.done()
})
}
exports.getTopChampions = function (test) {
championMastery.getTopChampions(playerId)
.then((data) => {
test.ok(data)
test.done()
})
}