* #361

* fix typo in db upgrade script

---------

Co-authored-by: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com>
This commit is contained in:
Dave HortonandHoan Luu Huu authored and GitHub committed 2024-11-26 20:25:25 -05:00
1 parent f9990da468
commit 843980c7f6
6 files changed
+43 -15

No files matched your search

+10 -2
View File
@@ -24,16 +24,24 @@ function makeSynthKey({account_sid = '', vendor, language, voice, engine = '', t
test('tts-cache', async(t) => {
const app = require('../app');
try {
// clear cache to start
let result = await request.delete('/TtsCache', {
auth: authAdmin,
resolveWithFullResponse: true,
});
t.ok(result.statusCode === 204, 'successfully purged cache for start of test');
// create caches
const minRecords = 8;
for (const i in Array(minRecords).fill(0)) {
await client.set(makeSynthKey({vendor: i, language: i, voice: i, engine: i, text: i}), i);
}
let result = await request.get('/TtsCache', {
result = await request.get('/TtsCache', {
auth: authAdmin,
json: true,
});
//console.log(result);
t.ok(result.size === minRecords, 'get cache correctly');
@@ -41,7 +49,7 @@ test('tts-cache', async(t) => {
auth: authAdmin,
resolveWithFullResponse: true,
});
t.ok(result.statusCode === 204, 'successfully deleted application after removing phone number');
t.ok(result.statusCode === 204, 'successfully purged cache');
result = await request.get('/TtsCache', {
auth: authAdmin,