lol-api-client
Version:
A Node client for interfacing with the League of Legends API
25 lines (21 loc) • 641 B
JavaScript
const Games = require('../lib/games')
require('dotenv').config({ silent: true })
const games = new Games(process.env['RIOT_API_KEY'], 'na', 'NA1')
const SUMMONER_ID = 5908
exports.getCurrent = function (test) {
games.getCurrent(SUMMONER_ID)
.then((data) => {
// Not sure how to test this since we either get an empty
// object if the summoner isn't in a game or match data if
// they are? TODO - flesh out this test case (maybe)
test.ok(data)
test.done()
})
}
exports.getRecent = function (test) {
games.getRecent(SUMMONER_ID)
.then((data) => {
test.ok(data)
test.done()
})
}