Skip to content

Commit

Permalink
Updated env var for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nmarus committed Jun 4, 2018
1 parent bea1a4e commit 531dd9e
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions test/_spark.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ const Spark = require('../index');
const validator = require('../validator');

describe('Test environment', () => {
it('has variable TOKEN defined', () => when(assert.strictEqual(typeof process.env.TOKEN, 'string', 'environment variable TOKEN is not defined')));
it('has variable TOKEN defined', () => when(assert.strictEqual(typeof process.env.SPARKY_API_TOKEN, 'string', 'environment variable TOKEN is not defined')));
});

describe('Test token', () => {
it('can authenticate to Spark API', () => validator.isToken(process.env.TOKEN)
it('can authenticate to Spark API', () => validator.isToken(process.env.SPARKY_API_TOKEN)
.then(token => when(assert((typeof token === 'string' && token.length > 0), 'token invalid'))));
});

describe('#Spark() constructor', () => {
it('returns a Spark instance', () => {
const spark = new Spark({ token: process.env.TOKEN });
const spark = new Spark({ token: process.env.SPARKY_API_TOKEN });
return when(assert(spark instanceof Spark, 'constructor error'));
});
});
4 changes: 2 additions & 2 deletions test/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const validator = require('../validator');

let orgEvents;

if (typeof process.env.TOKEN === 'string') {
const spark = new Spark({ token: process.env.TOKEN });
if (typeof process.env.SPARKY_API_TOKEN === 'string') {
const spark = new Spark({ token: process.env.SPARKY_API_TOKEN });

describe('#Spark.eventsGet()', () => {
it('returns an array of spark event objects', () => spark.eventsGet(10)
Expand Down
4 changes: 2 additions & 2 deletions test/licenses.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const validator = require('../validator');

let orgLicenses;

if (typeof process.env.TOKEN === 'string') {
const spark = new Spark({ token: process.env.TOKEN });
if (typeof process.env.SPARKY_API_TOKEN === 'string') {
const spark = new Spark({ token: process.env.SPARKY_API_TOKEN });

describe('#Spark.licensesGet()', () => {
it('returns an array of spark license objects', () => spark.licensesGet()
Expand Down
4 changes: 2 additions & 2 deletions test/memberships.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const validator = require('../validator');

let personMemberships;

if (typeof process.env.TOKEN === 'string') {
const spark = new Spark({ token: process.env.TOKEN });
if (typeof process.env.SPARKY_API_TOKEN === 'string') {
const spark = new Spark({ token: process.env.SPARKY_API_TOKEN });

describe('#Spark.membershipsGet()', () => {
it('returns an array of spark membership objects', () => spark.membershipsGet()
Expand Down
4 changes: 2 additions & 2 deletions test/organizations.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const when = require('when');
const Spark = require('../');
const validator = require('../validator');

if (typeof process.env.TOKEN === 'string') {
const spark = new Spark({ token: process.env.TOKEN });
if (typeof process.env.SPARKY_API_TOKEN === 'string') {
const spark = new Spark({ token: process.env.SPARKY_API_TOKEN });

describe('#Spark.organizationsGet()', () => {
it('returns an array of spark organization objects', () => spark.organizationsGet()
Expand Down
4 changes: 2 additions & 2 deletions test/people.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const when = require('when');
const Spark = require('../');
const validator = require('../validator');

if (typeof process.env.TOKEN === 'string') {
const spark = new Spark({ token: process.env.TOKEN });
if (typeof process.env.SPARKY_API_TOKEN === 'string') {
const spark = new Spark({ token: process.env.SPARKY_API_TOKEN });

describe('#Spark.personMe()', () => {
it('returns spark person object of authenticated account', () => spark.personMe()
Expand Down
4 changes: 2 additions & 2 deletions test/roles.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const when = require('when');
const Spark = require('../');
const validator = require('../validator');

if (typeof process.env.TOKEN === 'string') {
const spark = new Spark({ token: process.env.TOKEN });
if (typeof process.env.SPARKY_API_TOKEN === 'string') {
const spark = new Spark({ token: process.env.SPARKY_API_TOKEN });

describe('#Spark.rolesGet()', () => {
it('returns an array of spark role objects', () => spark.rolesGet()
Expand Down
4 changes: 2 additions & 2 deletions test/rooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ let spark;
let newRoom;
let personRooms;

if (typeof process.env.TOKEN === 'string') {
spark = new Spark({ token: process.env.TOKEN });
if (typeof process.env.SPARKY_API_TOKEN === 'string') {
spark = new Spark({ token: process.env.SPARKY_API_TOKEN });

describe('#Spark.roomsGet()', () => {
it('returns an array of spark room objects', () => spark.roomsGet()
Expand Down
4 changes: 2 additions & 2 deletions test/team-memberships.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const when = require('when');
const Spark = require('../');
const validator = require('../validator');

if (typeof process.env.TOKEN === 'string') {
const spark = new Spark({ token: process.env.TOKEN });
if (typeof process.env.SPARKY_API_TOKEN === 'string') {
const spark = new Spark({ token: process.env.SPARKY_API_TOKEN });

describe('#Spark.teamMembershipsGet(teamId)', () => {
it('returns an array of spark membership objects', () => spark.teamsGet(5)
Expand Down
4 changes: 2 additions & 2 deletions test/teams.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const when = require('when');
const Spark = require('../');
const validator = require('../validator');

if (typeof process.env.TOKEN === 'string') {
const spark = new Spark({ token: process.env.TOKEN });
if (typeof process.env.SPARKY_API_TOKEN === 'string') {
const spark = new Spark({ token: process.env.SPARKY_API_TOKEN });

describe('#Spark.teamsGet()', () => {
it('returns an array of spark team objects', () => spark.teamsGet()
Expand Down
4 changes: 2 additions & 2 deletions test/webhooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const validator = require('../validator');

let spark;

if (typeof process.env.TOKEN === 'string') {
spark = new Spark({ token: process.env.TOKEN });
if (typeof process.env.SPARKY_API_TOKEN === 'string') {
spark = new Spark({ token: process.env.SPARKY_API_TOKEN });

describe('#Spark.webhooksGet()', () => {
it('returns an array of spark webhook objects', () => spark.webhooksGet()
Expand Down

0 comments on commit 531dd9e

Please sign in to comment.