This repository has been archived by the owner on Sep 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Appears SpringCM does not return an error response on an invalid data center anymore.
- Loading branch information
1 parent
bdeb49a
commit 6a6bc48
Showing
1 changed file
with
48 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); | ||
}); |