Open sashafirsov opened 6 years ago
Extending the test code shortening idea by providing automatic fixture for describeFixture or itFixture:
describeFixture ('<some-element>', function ( ) {...
// beforeEach() will re-populate this.someElementInstance or pass it as parameter to it()
or
describe('<some-element>', function () {
itFixture('<some-element foo="baz"> can receive property `foo` </some-element>', function ( someEl ){
expect(someElement.foo).to.be.equal('baz');
Description
As for test author the splitting tested HTML and fixture(id) ( within HTML and test JS module ) become significant inconvenience. It forced to switch between HTML and JS while the size of common identifier (id) is often comparable to size of tested HTML itself
Proposed
To pass an HTML string which will be instantiated instead of template body on separate HTML.
Backward compatibe
The original signature with ID as parameter still will be in place. The HTML string could be detected either by presence of '<' character as 1st character of anywhere in string.
Benefits