This utility is fixture for QUnit.
JavaScript HTML
Latest commit fca0693 Feb 11, 2016 @mixed Version up
Failed to load latest commit information.
src init Feb 10, 2016
test init Feb 10, 2016
.gitignore Add ignore type Feb 11, 2016
.jscsrc init Feb 10, 2016
.jshintrc init Feb 10, 2016
Gruntfile.js init Feb 10, 2016
LICENSE Initial commit Feb 7, 2016 Update code type Feb 10, 2016
bower.json init Feb 10, 2016
package.json Version up Feb 11, 2016


This utility is fixture for QUnit.

Why use it?

If you have to use fixture It has some ways.

1. Add html in #fixture.

<div id="fixture">

This case has some cons. fixture is too hard to read and maintain If I have many fixture. For example. It can't know fixture in testcase. So. I search for #fixture in html but It is hard to search.

2. Append html using append or ....


This case has resolve uppon problem. but I feel like a hack.

So. I made fixture. If you use fixture you can easy use fixture.

How to use it?


npm install qunit-fixture


bower install qunit-fixture


<script src="jquery.js"></script>
<script src="../bower_components/qunit-fixture/fixture.js"></script>



  • parameter : (String) html
  • return : (NodeList) childNodes for #fixture


function plusWidth10px( id ){
    var currentWidth = document.getElementById( id ).style.width;
    document.getElementById( id ).style.width = currentWidth + 10;

QUnit.test( "QUnit.fixture should be return childeNodes of #qunit-fixture", function ( assert ) {
    var fixtureNodes = QUnit.fixture( "<div id='test' style='width:10px'></div>" );


    assert.equal( fixtureNodes[0].style.width, "20px" );