diff --git a/.eslintrc b/.eslintrc index b93ae60..b3fcd3b 100644 --- a/.eslintrc +++ b/.eslintrc @@ -94,4 +94,3 @@ rules: "no-path-concat": 0 "no-process-exit": 0 "eol-last": 2 - "key-spacing": 0 diff --git a/test/functional_test.js b/test/functional_test.js index a0270af..6825aed 100644 --- a/test/functional_test.js +++ b/test/functional_test.js @@ -1031,49 +1031,49 @@ function runOnPrefix(apiPrefix) { beforeEach(function(done) { calls = [ { - callId: randomBytes(16).toString("hex"), - wsCallerToken: randomBytes(16).toString("hex"), - wsCalleeToken: randomBytes(16).toString("hex"), - callerId: callerId, - userMac: userHmac, - apiKey: tokBoxConfig.credentials.default.apiKey, - sessionId: fakeCallInfo.session1, - calleeToken: fakeCallInfo.token1, - callToken: callToken, - callType: 'audio', + callId: randomBytes(16).toString("hex"), + wsCallerToken: randomBytes(16).toString("hex"), + wsCalleeToken: randomBytes(16).toString("hex"), + callerId: callerId, + userMac: userHmac, + apiKey: tokBoxConfig.credentials.default.apiKey, + sessionId: fakeCallInfo.session1, + calleeToken: fakeCallInfo.token1, + callToken: callToken, + callType: 'audio', urlCreationDate: urlCreationDate, - callState: constants.CALL_STATES.INIT, - timestamp: parseInt(Date.now() / 1000, 10) + callState: constants.CALL_STATES.INIT, + timestamp: parseInt(Date.now() / 1000, 10) }, { - callId: randomBytes(16).toString("hex"), - wsCallerToken: randomBytes(16).toString("hex"), - wsCalleeToken: randomBytes(16).toString("hex"), - callerId: callerId, - userMac: userHmac, - apiKey: tokBoxConfig.credentials.default.apiKey, - sessionId: fakeCallInfo.session2, - calleeToken: fakeCallInfo.token2, - callToken: callToken, - callType: 'audio-video', + callId: randomBytes(16).toString("hex"), + wsCallerToken: randomBytes(16).toString("hex"), + wsCalleeToken: randomBytes(16).toString("hex"), + callerId: callerId, + userMac: userHmac, + apiKey: tokBoxConfig.credentials.default.apiKey, + sessionId: fakeCallInfo.session2, + calleeToken: fakeCallInfo.token2, + callToken: callToken, + callType: 'audio-video', urlCreationDate: urlCreationDate, - callState: constants.CALL_STATES.INIT, - timestamp: parseInt(Date.now() / 1000, 10) + 1 + callState: constants.CALL_STATES.INIT, + timestamp: parseInt(Date.now() / 1000, 10) + 1 }, { - callId: randomBytes(16).toString("hex"), - wsCallerToken: randomBytes(16).toString("hex"), - wsCalleeToken: randomBytes(16).toString("hex"), - callerId: callerId, - userMac: userHmac, - apiKey: tokBoxConfig.credentials.default.apiKey, - sessionId: fakeCallInfo.session3, - calleeToken: fakeCallInfo.token2, - callState: constants.CALL_STATES.TERMINATED, - callToken: callToken, - callType: 'audio-video', + callId: randomBytes(16).toString("hex"), + wsCallerToken: randomBytes(16).toString("hex"), + wsCalleeToken: randomBytes(16).toString("hex"), + callerId: callerId, + userMac: userHmac, + apiKey: tokBoxConfig.credentials.default.apiKey, + sessionId: fakeCallInfo.session3, + calleeToken: fakeCallInfo.token2, + callState: constants.CALL_STATES.TERMINATED, + callToken: callToken, + callType: 'audio-video', urlCreationDate: urlCreationDate, - timestamp: parseInt(Date.now() / 1000, 10) + 2 + timestamp: parseInt(Date.now() / 1000, 10) + 2 } ]; @@ -1152,17 +1152,17 @@ function runOnPrefix(apiPrefix) { it("shouldn't list callToken and urls for a direct call", function(done) { var call = { - callId: randomBytes(16).toString("hex"), - wsCallerToken: randomBytes(16).toString("hex"), - wsCalleeToken: randomBytes(16).toString("hex"), - callerId: callerId, - userMac: userHmac, - apiKey: tokBoxConfig.credentials.default.apiKey, - sessionId: fakeCallInfo.session3, - calleeToken: fakeCallInfo.token2, - callState: constants.CALL_STATES.INIT, - callType: 'audio-video', - timestamp: parseInt(Date.now() / 1000, 10) + 3 + callId: randomBytes(16).toString("hex"), + wsCallerToken: randomBytes(16).toString("hex"), + wsCalleeToken: randomBytes(16).toString("hex"), + callerId: callerId, + userMac: userHmac, + apiKey: tokBoxConfig.credentials.default.apiKey, + sessionId: fakeCallInfo.session3, + calleeToken: fakeCallInfo.token2, + callState: constants.CALL_STATES.INIT, + callType: 'audio-video', + timestamp: parseInt(Date.now() / 1000, 10) + 3 }; req = supertest(app) diff --git a/test/storage_test.js b/test/storage_test.js index 1e6e250..ed1cb4f 100644 --- a/test/storage_test.js +++ b/test/storage_test.js @@ -35,47 +35,47 @@ describe("Storage", function() { a_second = 1 / 3600, // A second in hours. calls = [ { - callId: randomBytes(16).toString("hex"), - callerId: callerId, - userMac: userMac, - sessionId: fakeCallInfo.session1, - calleeToken: fakeCallInfo.token1, - callState: constants.CALL_STATES.INIT, - timestamp: now - 3 + callId: randomBytes(16).toString("hex"), + callerId: callerId, + userMac: userMac, + sessionId: fakeCallInfo.session1, + calleeToken: fakeCallInfo.token1, + callState: constants.CALL_STATES.INIT, + timestamp: now - 3 }, { - callId: randomBytes(16).toString("hex"), - callerId: callerId, - userMac: userMac, - sessionId: fakeCallInfo.session2, - calleeToken: fakeCallInfo.token2, - callState: constants.CALL_STATES.INIT, - timestamp: now - 2 + callId: randomBytes(16).toString("hex"), + callerId: callerId, + userMac: userMac, + sessionId: fakeCallInfo.session2, + calleeToken: fakeCallInfo.token2, + callState: constants.CALL_STATES.INIT, + timestamp: now - 2 }, { - callId: randomBytes(16).toString("hex"), - callerId: callerId, - userMac: userMac, - sessionId: fakeCallInfo.session3, - calleeToken: fakeCallInfo.token2, - callState: constants.CALL_STATES.TERMINATED, - timestamp: now - 1 + callId: randomBytes(16).toString("hex"), + callerId: callerId, + userMac: userMac, + sessionId: fakeCallInfo.session3, + calleeToken: fakeCallInfo.token2, + callState: constants.CALL_STATES.TERMINATED, + timestamp: now - 1 } ], call = calls[0], urls = [ { - timestamp: now, + timestamp: now, expires: now + callUrls.timeout, userMac: userMac }, { - timestamp: now + 1, + timestamp: now + 1, expires: now + callUrls.timeout, userMac: userMac }, { - timestamp: now + 2, + timestamp: now + 2, expires: now + callUrls.timeout, userMac: userMac } diff --git a/test/tokbox_test.js b/test/tokbox_test.js index a27d96c..7115ebf 100644 --- a/test/tokbox_test.js +++ b/test/tokbox_test.js @@ -37,7 +37,7 @@ describe("TokBox", function() { new TokBox({ credentials: { - default : { + default: { apiKey: apiKey, apiSecret: apiSecret }