convert tests to use new bootstrap

This commit is contained in:
Jake Luer 2012-11-29 03:18:48 -05:00
parent 5e07b04fdb
commit 86fe576d56
8 changed files with 20 additions and 85 deletions

View file

@ -1,25 +1,5 @@
/*!
* Module dependencies.
*
* Chai is automatically included in the browser.
*/
if (!chai) {
var chai = require('..');
}
var assert = chai.assert;
function err(fn, msg) {
try {
fn();
throw new chai.AssertionError({ message: 'Expected an error' });
} catch (err) {
assert.equal(msg, err.message);
}
}
suite('assert', function () {
var assert = chai.assert;
test('assert', function () {
var foo = 'bar';

View file

@ -4,10 +4,19 @@
<title>Mocha</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../node_modules/mocha/mocha.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="../../node_modules/mocha/mocha.js"></script>
<script>mocha.setup('tdd')</script>
<script src="../../chai.js"></script>
<script>
err = function (fn, msg) {
try {
fn();
throw new chai.AssertionError({ message: 'Expected an error' });
} catch (err) {
chai.expect(err.message).to.equal(msg);
}
};
</script>
<script src="../configuration.js"></script>
<script src="../expect.js"></script>
<script src="../should.js"></script>

View file

@ -1,14 +1,10 @@
if (!chai) {
var chai = require('..');
}
var assert = chai.assert;
function fooThrows () {
assert.equal('foo', 'bar');
}
suite('configuration', function () {
var assert = chai.assert;
function fooThrows () {
assert.equal('foo', 'bar');
}
test('Assertion.includeStack is true', function () {
chai.Assertion.includeStack = true;
try {

View file

@ -1,25 +1,5 @@
/*!
* Module dependencies.
*
* Chai is automatically included in the browser.
*/
if (!chai) {
var chai = require('..');
}
var expect = chai.expect;
function err(fn, msg) {
try {
fn();
throw new chai.AssertionError({ message: 'Expected an error' });
} catch (err) {
expect(err.message).to.equal(msg);
}
}
suite('expect', function () {
var expect = chai.expect;
test('chai.version', function() {
expect(chai).to.have.property('version');

View file

@ -1,10 +1,6 @@
if (!chai) {
var chai = require('..');
}
suite('global should', function () {
var theGlobal = typeof window !== 'undefined' ? window : global;
test('works', function () {
theGlobal.should = chai.should();
@ -14,5 +10,4 @@ suite('global should', function () {
delete theGlobal.should;
}
});
});

View file

@ -1,7 +1,3 @@
if (!chai) {
var chai = require('..');
}
suite('plugins', function () {
function plugin (chai) {

View file

@ -1,21 +1,3 @@
/**
* Module dependencies.
*/
if (!chai) {
var chai = require('..');
}
function err(fn, msg) {
try {
fn();
throw new chai.AssertionError({ message: 'Expected an error' });
} catch (err) {
chai.expect(err.message).to.equal(msg);
}
}
suite('should', function() {
var should = chai.Should();

View file

@ -1,8 +1,5 @@
if (!chai) var chai = require('..');
var expect = chai.expect;
suite('utilities', function () {
var expect = chai.expect;
test('_obj', function () {
var foo = 'bar'