New regression tests; fixed existing tests; bumped version #13

Merged
merged 3 commits into from Jan 11, 2013

Conversation

Projects
None yet
2 participants
Contributor

cbumgard commented Dec 13, 2012

  • Added a regression test for the previous media rule fix
  • Discovered all existing test cases failed because jsdom.html() -- called by /lib/utils/jsdom() -- wrapped all those /test/cases/*.out files with and tags which wasn't expected
  • Fixed (?) those test cases by adding missing html & body tags
  • Added a regression test for this case as well (/test/cases/jsdom.*)
  • Bumped the version to 0.0.7 so a new npm can be published and used by projects like mine that depend on it :)

FYI here's the code in jsdom that appears to add the html & body tags:

exports.html = function(html, level, options) {
  html += '';

  // TODO: cache a regex and use it here instead
  //       or make the parser handle it
  var htmlLowered = html.toLowerCase();

  // body
  if (!~htmlLowered.indexOf('<body')) {
    html = '<body>' + html + '</body>';
  }

  // html
  if (!~htmlLowered.indexOf('<html')) {
    html = '<html>' + html + '</html>';
  }
  return exports.jsdom(html, level, options);
};

cbumgard added some commits Dec 13, 2012

@cbumgard cbumgard regression test for previous fix for media queries. note i had to wra…
…p my test .out content in <html><body> tags in order to pass tests, it looks like they are appended at some point for partial html content which just guessing is new behavior from when these tests were written
498faec
@cbumgard cbumgard fixed test case expected outputs to have starting and ending <html> a…
…nd <body> tags as jsdom appends them in its html() function if they do not exist
779c4c8
@cbumgard cbumgard bumped version to account for new fix for @media queries 5d51b32

@rauchg rauchg added a commit that referenced this pull request Jan 11, 2013

@rauchg rauchg Merge pull request #13 from cbumgard/master
New regression tests; fixed existing tests; bumped version
69605a0

@rauchg rauchg merged commit 69605a0 into Automattic:master Jan 11, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment