mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 00:16:15 -04:00
pad_utils: Custom logger interface for warnDeprecated
This commit is contained in:
parent
248c114547
commit
908175d1ca
2 changed files with 29 additions and 2 deletions
26
src/tests/backend/specs/pad_utils.js
Normal file
26
src/tests/backend/specs/pad_utils.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
'use strict';
|
||||
|
||||
const assert = require('assert').strict;
|
||||
const {padutils} = require('../../../static/js/pad_utils');
|
||||
|
||||
describe(__filename, function () {
|
||||
describe('warnDeprecated', function () {
|
||||
const {warnDeprecated} = padutils;
|
||||
const backups = {};
|
||||
|
||||
before(async function () {
|
||||
backups.logger = warnDeprecated.logger;
|
||||
});
|
||||
|
||||
afterEach(async function () {
|
||||
warnDeprecated.logger = backups.logger;
|
||||
});
|
||||
|
||||
it('includes the stack', async function () {
|
||||
let got;
|
||||
warnDeprecated.logger = {warn: (stack) => got = stack};
|
||||
warnDeprecated();
|
||||
assert(got.includes(__filename));
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue