Skip to content

Commit 0a6f16b

Browse files
committed
Spec tidy
1 parent 62b43bf commit 0a6f16b

File tree

3 files changed

+30
-11
lines changed

3 files changed

+30
-11
lines changed

tests/specs/index.html

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
<body>
1010
<!-- Required for browser reporter -->
1111
<div id="mocha"></div>
12-
<div id="test"></div>
1312
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/1.18.2/mocha.min.js"></script>
1413
<script src="https://cdnjs.cloudflare.com/ajax/libs/expect.js/0.2.0/expect.min.js"></script>
1514
<script src="https://cdnjs.cloudflare.com/ajax/libs/sinon.js/1.7.3/sinon-min.js"></script>

tests/specs/unit/utils/args.js

+13-6
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,15 @@ describe('utils / args', function(){
4141

4242
var value = args({str:'s', obj: 'o', func : 'f'}, [function(){}]);
4343

44-
expect( value ).to.be.an( 'object' );
4544

46-
expect( value ).to.not.have.property('str');
45+
expect( value )
46+
47+
.to.be.an( 'object' )
48+
49+
.and.to.not.have.property('str')
50+
51+
.and.to.not.have.property('obj');
4752

48-
expect( value ).to.not.have.property('obj');
4953

5054
expect( value.func ).to.be.a( 'function' );
5155

@@ -57,11 +61,14 @@ describe('utils / args', function(){
5761
func : function(){}
5862
}]);
5963

60-
expect( value ).to.be.an( 'object' );
64+
expect( value )
65+
66+
.to.be.an( 'object' )
67+
68+
.and.to.not.have.property('str')
6169

62-
expect( value ).to.not.have.property('str');
70+
.and.to.not.have.property('obj');
6371

64-
expect( value ).to.not.have.property('obj');
6572

6673
expect( value.func ).to.be.a( 'function' );
6774

tests/specs/unit/utils/dataToJSON.js

+17-4
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,28 @@ define([
55
){
66

77
var utils = hello.utils;
8-
//
9-
// Test
10-
//
11-
var test = document.getElementById('test');
128

139
//
1410
// Are errors thrown if an invalid network is provided
1511
//
1612
describe('utils / dataToJSON', function(){
1713

14+
var test;
15+
16+
beforeEach(function(){
17+
18+
test = document.createElement('div');
19+
document.body.appendChild(test);
20+
21+
});
22+
23+
afterEach(function(){
24+
25+
test.parentNode.removeChild(test);
26+
27+
});
28+
29+
1830
it('should extrapolate the data in a form', function(){
1931

2032
// Create a form
@@ -42,6 +54,7 @@ define([
4254
// The data object can't be altered
4355
expect( obj.data.tagName.toUpperCase() ).to.be( "FORM" );
4456
}
57+
4558
});
4659
});
4760

0 commit comments

Comments
 (0)