Comparing version 0.44.1 to 0.44.2
@@ -500,1 +500,2 @@ import { AxiosError, Method } from 'axios' | ||
} | ||
//# sourceMappingURL=remote.it.d.ts.map |
@@ -9,1 +9,2 @@ export declare function parseLegacyDate(date: string, format: string): Date | ||
} | ||
//# sourceMappingURL=utils.d.ts.map |
{ | ||
"name": "remote.it", | ||
"version": "0.44.1", | ||
"version": "0.44.2", | ||
"description": "remote.it JavaScript/node client library", | ||
@@ -51,25 +51,2 @@ "main": "lib/remote.it.js", | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "24.0.18", | ||
"@types/jsdom": "12.2.4", | ||
"@types/luxon": "1.15.2", | ||
"eslint": "5.5.0", | ||
"eslint-config-standard": "12.0.0", | ||
"eslint-plugin-import": "2.14.0", | ||
"eslint-plugin-node": "7.0.1", | ||
"eslint-plugin-promise": "4.0.1", | ||
"eslint-plugin-standard": "4.0.0", | ||
"jest": "24.8.0", | ||
"jest-mock": "24.8.0", | ||
"lerna": "^3.16.4", | ||
"npm-run-all": "^4.1.5", | ||
"onchange": "5.2.0", | ||
"prettier": "1.14.3", | ||
"rimraf": "2.6.3", | ||
"size-limit": "1.3.2", | ||
"ts-jest": "24.1.0", | ||
"ts-node": "8.1.0", | ||
"tslint": "5.16.0", | ||
"typescript": "3.4.5" | ||
}, | ||
"bugs": { | ||
@@ -82,3 +59,4 @@ "url": "https://github.com/remoteit/remote.it.js/issues" | ||
}, | ||
"homepage": "https://github.com/remoteit/remote.it.js#readme" | ||
"homepage": "https://github.com/remoteit/remote.it.js#readme", | ||
"gitHead": "c6175d260913aab43652c9def883c9d5c247f3f6" | ||
} |
@@ -199,2 +199,42 @@ import setup, { | ||
describe('.sessionExpired', () => { | ||
let resp: any | ||
const username = 'user@remote.it' | ||
test('should test the current token', async () => { | ||
jest.spyOn(r3, 'get').mockResolvedValueOnce({}) | ||
resp = await r3.user.sessionExpired(username) | ||
expect(r3.get).toBeCalledWith(`/user/token/${r3.token}`) | ||
}) | ||
test('should handle a success response', async () => { | ||
jest.spyOn(r3, 'get').mockResolvedValueOnce({ | ||
status: 'true', | ||
email: 'user@remote.it', | ||
userid: 'user@remote.it', | ||
}) | ||
resp = await r3.user.sessionExpired(username) | ||
expect(resp).toEqual(false) | ||
}) | ||
test('should handle a success response with the wrong users token', async () => { | ||
jest.spyOn(r3, 'get').mockResolvedValueOnce({ | ||
status: 'true', | ||
email: 'different-user@remote.it', | ||
userid: 'different-user@remote.it', | ||
}) | ||
resp = await r3.user.sessionExpired(username) | ||
expect(resp).toEqual(true) | ||
}) | ||
test('should handle a failure response', async () => { | ||
jest.spyOn(r3, 'get').mockResolvedValueOnce({ | ||
status: 'false', | ||
message: 'Auth token expired', | ||
}) | ||
resp = await r3.user.sessionExpired(username) | ||
expect(resp).toEqual(true) | ||
}) | ||
}) | ||
describe('.login', () => { | ||
@@ -201,0 +241,0 @@ let resp: any |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
236104
0
30
4654