1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Tools: Fixed tests

This commit is contained in:
Laurent Cozic 2020-11-09 09:21:05 +00:00
parent 3223fd26f4
commit ca8b05631a
2 changed files with 2 additions and 2 deletions

View File

@ -508,6 +508,7 @@ async function expectNotThrow(asyncFn) {
} }
if (thrownError) { if (thrownError) {
console.error(thrownError);
expect(thrownError.message).toBe('', 'Expected function not to throw an error but it did'); expect(thrownError.message).toBe('', 'Expected function not to throw an error but it did');
} else { } else {
expect(true).toBe(true); expect(true).toBe(true);

View File

@ -92,8 +92,7 @@ export default class KvStore extends BaseService {
try { try {
const result = await this.db().selectOne('SELECT `value`, `type` FROM key_values WHERE `key` = ?', [key]); const result = await this.db().selectOne('SELECT `value`, `type` FROM key_values WHERE `key` = ?', [key]);
const value = this.formatValue_(result.value, result.type) as ValueType.Int; const newValue = result ? (this.formatValue_(result.value, result.type) as ValueType.Int) + inc : inc;
const newValue = result ? value + inc : inc;
await this.setValue(key, newValue); await this.setValue(key, newValue);
release(); release();
return newValue; return newValue;