Some variable cleanup in tests, removed creds from sample config.json
diff --git a/config.json b/config.json
deleted file mode 100644
index 3a82da0..0000000
--- a/config.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "appId": "sandbox",
- "authFallback": "NONE",
- "baseUrl": "https://api.usergrid.com",
- "clientId": "YXA6GXSAACS2EeOYd20aP4G6Lw",
- "clientSecret": "YXA66BeEvgNpJBwc4PAbvZZGTVS_SSw",
- "orgId": "brandon.apigee"
-}
\ No newline at end of file
diff --git a/config.sample.json b/config.sample.json
new file mode 100644
index 0000000..a15a6a5
--- /dev/null
+++ b/config.sample.json
@@ -0,0 +1,8 @@
+{
+ "appId": "yourAppId",
+ "authFallback": "NONE",
+ "baseUrl": "https://api.usergrid.com",
+ "clientId": "yourClientId",
+ "clientSecret": "yourClientSecret",
+ "orgId": "yourOrgId"
+}
\ No newline at end of file
diff --git a/tests/lib/response.test.js b/tests/lib/response.test.js
index e5f9fd1..e897f84 100644
--- a/tests/lib/response.test.js
+++ b/tests/lib/response.test.js
@@ -10,12 +10,14 @@
var client = new UsergridClient()
-var _response
+var _response,
+ _slow = 500,
+ _timeout = 4000
before(function(done) {
- this.slow(1000)
- this.timeout(6000)
+ this.slow(_slow)
+ this.timeout(_timeout)
client.GET(config.testCollection, function(err, usergridResponse) {
_response = usergridResponse
@@ -48,8 +50,8 @@
describe('error', function() {
it('should be a UsergridResponseError object', function(done) {
- this.slow(1000)
- this.timeout(6000)
+ this.slow(_slow)
+ this.timeout(_timeout)
client.GET(config.testCollection, 'BADNAMEORUUID', function(err, usergridResponse) {
usergridResponse.error.should.be.an.instanceof(UsergridResponseError)
@@ -60,8 +62,8 @@
describe('users', function() {
- this.slow(1000)
- this.timeout(6000)
+ this.slow(_slow)
+ this.timeout(_timeout)
it('response.users should be an array of UsergridUser objects', function(done) {
client.setAppAuth(config.clientId, config.clientSecret, config.tokenTtl)
@@ -81,8 +83,8 @@
describe('user', function() {
- this.slow(1000)
- this.timeout(6000)
+ this.slow(_slow)
+ this.timeout(_timeout)
var user
@@ -131,8 +133,8 @@
})
describe('hasNextPage', function() {
- this.slow(1000)
- this.timeout(6000)
+ this.slow(_slow)
+ this.timeout(_timeout)
it('should be true when more entities exist', function(done) {
client.GET(config.testCollection, function(err, usergridResponse) {
diff --git a/tests/lib/responseError.test.js b/tests/lib/responseError.test.js
index c00dcba..a100917 100644
--- a/tests/lib/responseError.test.js
+++ b/tests/lib/responseError.test.js
@@ -7,14 +7,16 @@
var client = new UsergridClient()
-var _response
+var _response,
+ _slow = 500,
+ _timeout = 4000
describe('name, description, exception', function() {
before(function(done) {
- this.slow(1000)
- this.timeout(6000)
+ this.slow(_slow)
+ this.timeout(_timeout)
client.GET(config.testCollection, 'BADNAMEORUUID', function(err, usergridResponse) {
_response = usergridResponse
@@ -34,8 +36,8 @@
describe('undefined check', function() {
it('response.error should be undefined on a successful response', function(done) {
- this.slow(1000)
- this.timeout(6000)
+ this.slow(_slow)
+ this.timeout(_timeout)
client.GET(config.testCollection, function(err, usergridResponse) {
usergridResponse.statusCode.should.equal(200)
should(usergridResponse.error).be.undefined()