head
and a body
. The body
element on the page.
- testString: assert($('body').length == 1);
+ testString: |
+ const bodyElems = code.replace(/\n/g,'').match(/.*?<\/body\s*>/g);
+ assert(bodyElems && bodyElems.length === 1);
- text: The head
element should be a child of the html
element.
- testString: assert($('html').children('head').length == 1);
- - text: The body
element should be a child of the html
element.
- testString: assert($('html').children('body').length == 1);
- - text: The head
element should wrap around the title
element.
- testString: assert(code.match(/\s*?body
element should wrap around both the h1
and p
elements.
- testString: assert(code.match(/(.*\s*)*?<\/p>\s*?))|((
\s*?.*?\s*?<\/p>\s*?)(
body
element should be a child of the html
element.
+ testString: |
+ const htmlChildren = code.replace(/\n/g,'').match(/(?head
element should wrap around the title
element.
+ testString: |
+ const headChildren = code.replace(/\n/g,'').match(/(?body
element should wrap around both the h1
and p
elements.
+ testString: |
+ const bodyChildren = code.replace(/\n/g,'').match(/.*<\/p\s*>/g); + const numH1s = h1s ? h1s.length : 0; + const numPs = ps ? ps.length : 0; + foundElems = numH1s === 1 && numPs === 1; + } + assert(foundElems); ```