mirror of
https://github.com/liriliri/eruda.git
synced 2026-03-20 09:38:37 +08:00
Fix: Max log number
This commit is contained in:
@@ -195,4 +195,33 @@ describe('filter', function ()
|
||||
|
||||
tool.filter('all');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('config', function ()
|
||||
{
|
||||
var config = tool.config;
|
||||
|
||||
it('max number', function ()
|
||||
{
|
||||
config.set('maxLogNum', '10');
|
||||
tool.clear();
|
||||
for (var i = 0; i < 20; i++) tool.log(i);
|
||||
expect($tool.find('.eruda-log-item')).toHaveLength(10);
|
||||
});
|
||||
|
||||
it('override console', function ()
|
||||
{
|
||||
config.set('overrideConsole', true);
|
||||
console.clear();
|
||||
console.log('test');
|
||||
expect($tool.find('.eruda-log-item')).toContainText('test');
|
||||
});
|
||||
|
||||
it('display extra info', function ()
|
||||
{
|
||||
config.set('displayExtraInfo', true);
|
||||
tool.clear().log('test');
|
||||
expect($tool.find('.eruda-logs li')).toContainElement('.eruda-header');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user