Better usage of pino

This commit is contained in:
Fedor Indutny
2025-06-16 09:47:18 -07:00
committed by GitHub
parent 58f006aac2
commit f6c19c548e
60 changed files with 489 additions and 738 deletions

View File

@@ -21,15 +21,29 @@ describe('updateDefaultSession', () => {
it('sets the spellcheck URL', () => {
const sesh = session.fromPartition(uuid());
const stub = sandbox.stub(sesh, 'setSpellCheckerDictionaryDownloadURL');
const getLogger = sandbox.stub();
updateDefaultSession(sesh, getLogger);
const logger = {
fatal: sandbox.stub(),
error: sandbox.stub(),
warn: sandbox.stub(),
info: sandbox.stub(),
debug: sandbox.stub(),
trace: sandbox.stub(),
child: sandbox.stub(),
};
updateDefaultSession(sesh, logger);
sinon.assert.calledOnce(stub);
sinon.assert.calledWith(
stub,
`https://updates.signal.org/desktop/hunspell_dictionaries/${process.versions.electron}/`
);
sinon.assert.notCalled(getLogger);
sinon.assert.notCalled(logger.fatal);
sinon.assert.notCalled(logger.error);
sinon.assert.notCalled(logger.warn);
sinon.assert.notCalled(logger.info);
sinon.assert.notCalled(logger.debug);
sinon.assert.notCalled(logger.trace);
sinon.assert.notCalled(logger.child);
});
});