File tree 3 files changed +30
-11
lines changed
3 files changed +30
-11
lines changed Original file line number Diff line number Diff line change 9
9
< body >
10
10
<!-- Required for browser reporter -->
11
11
< div id ="mocha "> </ div >
12
- < div id ="test "> </ div >
13
12
< script src ="https://cdnjs.cloudflare.com/ajax/libs/mocha/1.18.2/mocha.min.js "> </ script >
14
13
< script src ="https://cdnjs.cloudflare.com/ajax/libs/expect.js/0.2.0/expect.min.js "> </ script >
15
14
< script src ="https://cdnjs.cloudflare.com/ajax/libs/sinon.js/1.7.3/sinon-min.js "> </ script >
Original file line number Diff line number Diff line change @@ -41,11 +41,15 @@ describe('utils / args', function(){
41
41
42
42
var value = args ( { str :'s' , obj : 'o' , func : 'f' } , [ function ( ) { } ] ) ;
43
43
44
- expect ( value ) . to . be . an ( 'object' ) ;
45
44
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' ) ;
47
52
48
- expect ( value ) . to . not . have . property ( 'obj' ) ;
49
53
50
54
expect ( value . func ) . to . be . a ( 'function' ) ;
51
55
@@ -57,11 +61,14 @@ describe('utils / args', function(){
57
61
func : function ( ) { }
58
62
} ] ) ;
59
63
60
- expect ( value ) . to . be . an ( 'object' ) ;
64
+ expect ( value )
65
+
66
+ . to . be . an ( 'object' )
67
+
68
+ . and . to . not . have . property ( 'str' )
61
69
62
- expect ( value ) . to . not . have . property ( 'str ' ) ;
70
+ . and . to . not . have . property ( 'obj ' ) ;
63
71
64
- expect ( value ) . to . not . have . property ( 'obj' ) ;
65
72
66
73
expect ( value . func ) . to . be . a ( 'function' ) ;
67
74
Original file line number Diff line number Diff line change @@ -5,16 +5,28 @@ define([
5
5
) {
6
6
7
7
var utils = hello . utils ;
8
- //
9
- // Test
10
- //
11
- var test = document . getElementById ( 'test' ) ;
12
8
13
9
//
14
10
// Are errors thrown if an invalid network is provided
15
11
//
16
12
describe ( 'utils / dataToJSON' , function ( ) {
17
13
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
+
18
30
it ( 'should extrapolate the data in a form' , function ( ) {
19
31
20
32
// Create a form
@@ -42,6 +54,7 @@ define([
42
54
// The data object can't be altered
43
55
expect ( obj . data . tagName . toUpperCase ( ) ) . to . be ( "FORM" ) ;
44
56
}
57
+
45
58
} ) ;
46
59
} ) ;
47
60
You can’t perform that action at this time.
0 commit comments