Skip to content
This repository has been archived by the owner on Jul 4, 2019. It is now read-only.

isisbusapps/chai-fixture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chai-fixture

Adds DOM fixture support for Chai

Supports: Mocha, Jasmine, QUnit and possibly others. If your favourite test framework doesn't work please file an issue.

Install

NPM

npm install chai-fixture

Bower

bower install chai-fixture

CDN

<script src="https://cdn.rawgit.com/isisbusapps/chai-fixture/master/chai-fixture.js"></script>

Usage

NodeJS

Note: Requires document to exists. (I recommend using PhantomJS or similar)

var chai = require('chai');
var chaiFixture = require('chai-fixture');
chai.use(chaiFixture);

// Access fixture element
chai.fixture.setAttribute('background-color', 'red');

Browser

<script src="../node_modules/chai/chai.js"></script>
<script src="../node_modules/chai-fixture/chai-fixture.js"></script>
<script>
  chai.use(chaiFixture);

  // Access fixture element
  chai.fixture.setAttribute('background-color', 'red');
</script>

About

Adds DOM fixture support for Chai

Resources

License

Stars

Watchers

Forks

Packages

No packages published