Hemmelig.app/tests/server/helpers/validate-ttl.test.js
bjarneo 0c86efd56c
refactor: use fastify vite for the dev server (#284)
* refactor: use fastify vite for the server

by doing this we do not need to have local hacks for the routes. No local proxy needed. Everything just works.

* fix: update the dockerfile build path

* fix: update package.json

* fix: fonts path
2024-03-11 13:43:20 +01:00

20 lines
646 B
JavaScript

import assert from 'assert';
import isValidTTL from '../../../server/helpers/validate-ttl.js';
describe('Validate TTL', () => {
describe('#isValidTTL(ttl)', () => {
it('should validate x seconds to be true', async () => {
assert.equal(isValidTTL(300), true);
assert.equal(isValidTTL(14400), true);
assert.equal(isValidTTL(604800), true);
});
it('should validate x seconds to be false', async () => {
assert.equal(isValidTTL(301), false);
assert.equal(isValidTTL(14401), false);
assert.equal(isValidTTL(604801), false);
});
});
});