0ca8b1df20
As discussed in #10085, the original replacement string can be treated as html when displayed by the browser so it replaces it with '...' string. Closes #10103
16 lines
575 B
JavaScript
16 lines
575 B
JavaScript
'use strict';
|
|
|
|
describe('toDebugString', function() {
|
|
it('should convert its argument to a string', function() {
|
|
expect(toDebugString('string')).toEqual('string');
|
|
expect(toDebugString(123)).toEqual('123');
|
|
expect(toDebugString({a:{b:'c'}})).toEqual('{"a":{"b":"c"}}');
|
|
expect(toDebugString(function fn() { var a = 10; })).toEqual('function fn()');
|
|
expect(toDebugString()).toEqual('undefined');
|
|
var a = { };
|
|
a.a = a;
|
|
expect(toDebugString(a)).toEqual('{"a":"..."}');
|
|
expect(toDebugString([a,a])).toEqual('[{"a":"..."},"..."]');
|
|
});
|
|
});
|