Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation site #200

Merged
merged 23 commits into from
Apr 8, 2018
Merged

Documentation site #200

merged 23 commits into from
Apr 8, 2018

Conversation

sunesimonsen
Copy link
Member

@sunesimonsen sunesimonsen commented Mar 19, 2018

  • <DOMElement> to have text <any>
  • <DOMElement> to [only] have (attribute|attributes) <array|object>
  • <DOMElement> to [only] have (attribute|attributes) <string+>
  • <DOMElement> not to have (attribute|attributes) <array>
  • <DOMElement> not to have (attribute|attributes) <string+>
  • <DOMElement> to [exhaustively] satisfy <string>
  • <DOMElement> to [exhaustively] satisfy <object>
  • <DOMElement> to [exhaustively] satisfy <DOMElement>
  • <DOMElement> to have [no] (child|children)
  • <DOMElement> to have (class|classes) <array|string>
  • <DOMElement> to only have (class|classes) <array|string>
  • <DOMDocument|DOMElement|DOMDocumentFragment> to contain [no] elements matching <string>
  • <DOMNodeList> to [exhaustively] satisfy <DOMNodeList>
  • <DOMDocument|DOMElement|DOMDocumentFragment> [not] to match <string>
  • <DOMDocument|DOMElement|DOMDocumentFragment> [when] queried for [first] <string> <assertion?>
  • <string> when parsed as HTML <assertion>
  • <string> when parsed as XML <assertion>

Stuff that might be covered by the above.

  • <DOMTextNode> to [exhaustively] satisfy <DOMElement>
  • <DOMElement> to [exhaustively] satisfy <DOMTextNode>
  • <DOMDocument> to [exhaustively] satisfy <DOMDocument>
  • <DOMDocumentFragment> to [exhaustively] satisfy <object|array>
  • <DOMDocumentFragment> to [exhaustively] satisfy <DOMDocumentFragment>
  • <DOMTextNode> to [exhaustively] satisfy <DOMTextNode>
  • <DOMTextNode> to [exhaustively] satisfy <regexp>
  • <DOMDocument> to [exhaustively] satisfy <string>
  • <DOMDocumentFragment> to [exhaustively] satisfy <string>
  • <DOMTextNode> to [exhaustively] satisfy <object>
  • <DOMTextNode> to [exhaustively] satisfy <any>

This is too weird:

  • <DOMNodeList> to [exhaustively] satisfy <string>

@sunesimonsen sunesimonsen force-pushed the ssimonsen/documentation-site branch 3 times, most recently from 31d47e1 to ae6ce8a Compare March 27, 2018 20:53
@sunesimonsen sunesimonsen force-pushed the ssimonsen/documentation-site branch 4 times, most recently from 4bc51eb to 75d078b Compare March 31, 2018 10:01
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.8%) to 93.211% when pulling 75d078b on ssimonsen/documentation-site into 10b22a0 on master.

@coveralls
Copy link

coveralls commented Mar 31, 2018

Coverage Status

Coverage increased (+0.7%) to 94.737% when pulling 571b73e on ssimonsen/documentation-site into 2fc89c3 on master.

@sunesimonsen sunesimonsen force-pushed the ssimonsen/documentation-site branch 4 times, most recently from e8fdf71 to 1a0d3db Compare April 3, 2018 20:41
@sunesimonsen
Copy link
Member Author

Prepublished here https://munter.github.io/unexpected-dom/

@sunesimonsen sunesimonsen force-pushed the ssimonsen/documentation-site branch from 91b128a to ada9505 Compare April 4, 2018 05:49
@sunesimonsen sunesimonsen requested a review from papandreou April 4, 2018 17:47
@sunesimonsen sunesimonsen changed the title [WIP] documentation site Documentation site Apr 4, 2018
@sunesimonsen
Copy link
Member Author

@papandreou don't know what is up with Coveralls, I would expect the coverage to go up.

@papandreou
Copy link
Member

Istanbul seems to agree with coveralls.

Before (master, 31d8e83)

=============================== Coverage summary ===============================
Statements   : 94.03% ( 504/536 )
Branches     : 85.5% ( 283/331 )
Functions    : 95.62% ( 131/137 )
Lines        : 94.03% ( 504/536 )
================================================================================

After (ssimonsen/documentation-site, 2113973)

=============================== Coverage summary ===============================
Statements   : 93.62% ( 514/549 )
Branches     : 84.89% ( 281/331 )
Functions    : 96.43% ( 135/140 )
Lines        : 93.62% ( 514/549 )
================================================================================

And roughly the same after rebasing ssimonsen/documentation-site on master:

=============================== Coverage summary ===============================
Statements   : 93.66% ( 517/552 )
Branches     : 84.98% ( 283/333 )
Functions    : 96.43% ( 135/140 )
Lines        : 93.66% ( 517/552 )
================================================================================

Comparing the two coverage reports, the difference seems to be down to the introduction of <DOMElement> to [exhaustively] satisfy <regexp>, which doesn't get any coverage, and the fact that the jsdom-based parsing doesn't get coverage anymore (before on the left):

coverage_diff

The reason is that bootstrap-unexpected-markdown.js now sets up a document global, and it's being unconditionally included when running the test suite, not just the documentation tests: https://github.com/Munter/unexpected-dom/blob/2113973bc4e311d5b98f6233974b155e28dafa25/test/mocha.opts#L2

Copy link
Member

@papandreou papandreou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, this looks great! 🚢

I found a few typos, PR here: #207

When reading through the docs was a little unsure about the createElement function, which might be mistaken for a built-in function because it's not explicitly defined on the doc site. On the other hand, the function itself isn't really the point, and it's perfectly understandable what it does, so it's probably not worth spending too many words on explaining it :)

@sunesimonsen
Copy link
Member Author

Thanks for the explanation, let me create a test for the new addition. About the creareElement function, let's see if people gets confused about it.

@sunesimonsen sunesimonsen force-pushed the ssimonsen/documentation-site branch from cb1d0d4 to 1fe8de8 Compare April 8, 2018 17:53
@sunesimonsen sunesimonsen merged commit 94886a7 into master Apr 8, 2018
@sunesimonsen sunesimonsen deleted the ssimonsen/documentation-site branch April 8, 2018 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants