virtual-dom-chai
A chai plugin for virtual-dom.
Inspired by staltz/chai-virtual-dom
Usage
Basics:
tohave;tohavetext'hello';tohave;tohaveclasses'foo' 'bar' 'baz';tohave;tohave;tohave;
Subtree expectations:
tohaveasubtreewithinside;tohaveasubtreewithtext'hello'inside;tohaveasubtreewithinside;tohaveasubtreewithclasses'foo' 'bar' 'baz'insidetohaveasubtreewithinside;
Important! To use subtree expectations you must end your chai matchers with '
inside
'. If you fail to do this, no assertion will be made by chai, and the expectation will always pass (the value oftree
will be ignored).
Chaining:
tohaveandtext'world';tohaveandtext'world'and;tohaveasubtreewithwithinside;tohaveasubtreewithandtext'hello'inside;
Locating:
attohave;attohaveasubtreewithinside;
Delegating to core chai:
tohavechildrenbelow3;tohaveclassesthatinclude;tohavetextthathaslength;tohavestylesthathaveall;
Installation
npm install virtual-dom-chai --save-dev
var chai = ;chai;
License
MIT License.
Copyright © 2016 James Lawson