describe('jasmineUnderTest.pp (HTML Dependent)', function() { it('should stringify non-element HTML nodes properly', function() { var sampleNode = document.createTextNode(''); expect(jasmineUnderTest.pp(sampleNode)).toEqual('HTMLNode'); expect(jasmineUnderTest.pp({ foo: sampleNode })).toEqual( 'Object({ foo: HTMLNode })' ); }); it('should stringify empty HTML elements as their opening tags', function() { var simple = document.createElement('div'); simple.className = 'foo'; expect(jasmineUnderTest.pp(simple)).toEqual('
'); }); it('should stringify non-empty HTML elements as tags with placeholders', function() { var nonEmpty = document.createElement('div'); nonEmpty.className = 'foo'; nonEmpty.innerHTML = '

Irrelevant

'; expect(jasmineUnderTest.pp(nonEmpty)).toEqual('
...
'); }); it("should print Firefox's wrapped native objects correctly", function() { if (jasmine.getEnv().firefoxVersion) { try { new CustomEvent(); } catch (e) { var err = e; } // Different versions of FF produce different error messages. expect(jasmineUnderTest.pp(err)).toMatch( /Not enough arguments|CustomEvent requires at least 1 argument, but only 0 were passed/ ); } }); it('should stringify HTML element with text and attributes', function() { var el = document.createElement('div'); el.setAttribute('things', 'foo'); el.innerHTML = 'foo'; expect(jasmineUnderTest.pp(el)).toEqual('
...
'); }); });