Added session length option for session tokens to server configuration
This commit is contained in:
committed by
Florent Vilmart
parent
51664c8f33
commit
f99b5588ab
@@ -280,4 +280,37 @@ describe('server', () => {
|
||||
}) ).toThrow("publicServerURL should be a valid HTTPS URL starting with https://");
|
||||
done();
|
||||
});
|
||||
|
||||
it('fails if the session length is not a number', (done) => {
|
||||
expect(() => setServerConfiguration({
|
||||
serverURL: 'http://localhost:8378/1',
|
||||
appId: 'test',
|
||||
appName: 'unused',
|
||||
javascriptKey: 'test',
|
||||
masterKey: 'test',
|
||||
sessionLength: 'test'
|
||||
})).toThrow('Session length must be a valid number.');
|
||||
done();
|
||||
});
|
||||
|
||||
it('fails if the session length is less than or equal to 0', (done) => {
|
||||
expect(() => setServerConfiguration({
|
||||
serverURL: 'http://localhost:8378/1',
|
||||
appId: 'test',
|
||||
appName: 'unused',
|
||||
javascriptKey: 'test',
|
||||
masterKey: 'test',
|
||||
sessionLength: '-33'
|
||||
})).toThrow('Session length must be a value greater than 0.');
|
||||
|
||||
expect(() => setServerConfiguration({
|
||||
serverURL: 'http://localhost:8378/1',
|
||||
appId: 'test',
|
||||
appName: 'unused',
|
||||
javascriptKey: 'test',
|
||||
masterKey: 'test',
|
||||
sessionLength: '0'
|
||||
})).toThrow('Session length must be a value greater than 0.');
|
||||
done();
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user