Skip to content
This repository has been archived by the owner on Sep 25, 2020. It is now read-only.

Commit

Permalink
Remove invalid data center test
Browse files Browse the repository at this point in the history
Appears SpringCM does not return an error response on an invalid data
center anymore.
  • Loading branch information
bronsonholden committed Jun 27, 2019
1 parent bdeb49a commit 6a6bc48
Showing 1 changed file with 48 additions and 59 deletions.
107 changes: 48 additions & 59 deletions test/client.js
Original file line number Diff line number Diff line change
@@ -1,59 +1,48 @@
const { describe, it } = require('mocha');
const { expect } = require('chai');
const _ = require('lodash');
const SpringCM = require('../');
const env = require('./env');

describe('client', function () {
this.timeout(10000);

it('connect and close', function (done) {
var springCm = new SpringCM(env);

springCm.connect((err) => {
expect(err).to.not.exist;

springCm.close(done);
});
});

it('handles invalid clientId', function (done) {
var springCm = new SpringCM(_.defaults({
clientId: 'invalid'
}, env));

springCm.connect((err) => {
expect(err).to.be.an('error');
done();
});
});

it('handles invalid clientSecret', function (done) {
var springCm = new SpringCM(_.defaults({
clientSecret: 'invalid'
}, env));

springCm.connect((err) => {
expect(err).to.be.an('error');
done();
});
});

it('handles invalid dataCenter', function (done) {
var springCm = new SpringCM(_.defaults({
dataCenter: 'invalid'
}, env));

springCm.connect((err) => {
expect(err).to.be.an('error');
done();
});
});

it('runs idle tasks', function (done) {
var springCm = new SpringCM(env);
springCm.queue.push({
idle: 1000
}, 0, done);
});
});
const { describe, it } = require('mocha');
const { expect } = require('chai');
const _ = require('lodash');
const SpringCM = require('../');
const env = require('./env');

describe('client', function () {
this.timeout(10000);

it('connect and close', function (done) {
var springCm = new SpringCM(env);

springCm.connect((err) => {
expect(err).to.not.exist;

springCm.close(done);
});
});

it('handles invalid clientId', function (done) {
var springCm = new SpringCM(_.defaults({
clientId: 'invalid'
}, env));

springCm.connect((err) => {
expect(err).to.be.an('error');
done();
});
});

it('handles invalid clientSecret', function (done) {
var springCm = new SpringCM(_.defaults({
clientSecret: 'invalid'
}, env));

springCm.connect((err) => {
expect(err).to.be.an('error');
done();
});
});

it('runs idle tasks', function (done) {
var springCm = new SpringCM(env);
springCm.queue.push({
idle: 1000
}, 0, done);
});
});

0 comments on commit 6a6bc48

Please sign in to comment.