mirror of
https://github.com/liriliri/eruda.git
synced 2026-03-20 09:38:37 +08:00
Dev: Console refactoring
This commit is contained in:
@@ -18,12 +18,47 @@ describe('log', function ()
|
||||
tool.clear().log(obj);
|
||||
expect($tool.find('.eruda-log')).toContainText('Object {"a":1}');
|
||||
});
|
||||
|
||||
it('html', function ()
|
||||
{
|
||||
tool.clear().html('<span class="color-blue">Blue</span>');
|
||||
expect($tool.find('.eruda-html')).toContainElement('span.color-blue');
|
||||
});
|
||||
|
||||
it('timer', function ()
|
||||
{
|
||||
tool.clear().time('eruda');
|
||||
tool.clear().timeEnd('eruda');
|
||||
expect($tool.find('.eruda-html')).toHaveText(/eruda: \d+ms/);
|
||||
});
|
||||
});
|
||||
|
||||
describe('substitution', function ()
|
||||
{
|
||||
it('number', function ()
|
||||
{
|
||||
tool.clear().log('Eruda is %d', 1, 'year old');
|
||||
expect($tool.find('.eruda-log')).toContainText('Eruda is 1 year old');
|
||||
});
|
||||
|
||||
it('string', function ()
|
||||
{
|
||||
tool.clear().log('My name is %s', 'eruda');
|
||||
expect($tool.find('.eruda-log')).toContainText('My name is eruda');
|
||||
});
|
||||
|
||||
it('object', function ()
|
||||
{
|
||||
tool.clear().log('Object is %o', {a: 1});
|
||||
expect($tool.find('.eruda-log')).toContainText('Object is {"a":1}');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
describe('filter', function ()
|
||||
{
|
||||
// Test case from https://github.com/liriliri/eruda/issues/14
|
||||
it('function', function ()
|
||||
/*it('function', function ()
|
||||
{
|
||||
tool.clear().filter(function (log)
|
||||
{
|
||||
@@ -41,5 +76,5 @@ describe('filter', function ()
|
||||
});
|
||||
tool.log(obj);
|
||||
expect($tool.find('.eruda-logs li').length).toEqual(1);
|
||||
});
|
||||
});*/
|
||||
});
|
||||
Reference in New Issue
Block a user