UNPKG

cody-music

Version:

mac osx spotify and itunes music player controller, spotify audio features, itunes and spotify genre, and playlist control

37 lines 1.53 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const expect = require("chai").expect; const CodyMusic = require("../../index"); const util_1 = require("../util"); const testUtil = new util_1.TestUtil(); /** * Don't add "async" into the it condition. * i.e. it("description text", async (done) => { * // do stuff * }); * It will return the following error if you do. * "Error: Resolution method is overspecified. Specify a callback *or* return a Promise; not both." */ describe("recently playing tracks tests", () => { it("Validate refreshing an expired access token", async () => { testUtil.initializeSpotifyConfig('expired'); expect(await CodyMusic.accessExpired()).to.be.false; }); it("Validate getting non-expired token response", async () => { testUtil.initializeSpotifyConfig(); expect(await CodyMusic.accessExpired()).to.be.false; }); it("Validate getting non-expired token response", async () => { testUtil.initializeSpotifyConfig('expired', 'bad_secret'); expect(await CodyMusic.accessExpired()).to.be.true; }); it("Returns a 401 status", async () => { const resp = await CodyMusic.pause(CodyMusic.PlayerName.SpotifyWeb); expect(resp.status).to.equal(401); }); it("Returns an expired status text", async () => { const resp = await CodyMusic.pause(CodyMusic.PlayerName.SpotifyWeb); expect(resp.statusText).to.equal('EXPIRED'); }); }); //# sourceMappingURL=test.js.map