@@ -31,7 +31,7 @@ test('CSSAngleValue constructor works for valid arguments', function() {
31
31
] ;
32
32
for ( var i = 0 ; i < values . length ; i ++ ) {
33
33
assert . instanceOf ( values [ i ] , CSSAngleValue ) ;
34
- assert . approximately ( values [ i ] . degrees , expectations [ i ] . degrees , EPSILON ) ;
34
+ assert . closeTo ( values [ i ] . degrees , expectations [ i ] . degrees , EPSILON ) ;
35
35
assert . strictEqual ( values [ i ] . _value , expectations [ i ] . value ) ;
36
36
assert . strictEqual ( values [ i ] . _unit , expectations [ i ] . unit ) ;
37
37
assert . strictEqual ( values [ i ] . cssText , expectations [ i ] . cssText ) ;
@@ -62,32 +62,32 @@ test('Invalid unit throws', function() {
62
62
test ( 'Conversions when specified as degrees' , function ( ) {
63
63
var angleValue = new CSSAngleValue ( 40 , 'deg' ) ;
64
64
assert . strictEqual ( angleValue . degrees , 40 ) ;
65
- assert . approximately ( angleValue . radians , 0.698132 , EPSILON ) ;
66
- assert . approximately ( angleValue . gradians , 44.444444 , EPSILON ) ;
67
- assert . approximately ( angleValue . turns , 0.111111 , EPSILON ) ;
65
+ assert . closeTo ( angleValue . radians , 0.698132 , EPSILON ) ;
66
+ assert . closeTo ( angleValue . gradians , 44.444444 , EPSILON ) ;
67
+ assert . closeTo ( angleValue . turns , 0.111111 , EPSILON ) ;
68
68
} ) ;
69
69
70
70
test ( 'Conversions when specified as radians' , function ( ) {
71
71
var angleValue = new CSSAngleValue ( 100 , 'rad' ) ;
72
- assert . approximately ( angleValue . degrees , 5729.577951 , EPSILON ) ;
72
+ assert . closeTo ( angleValue . degrees , 5729.577951 , EPSILON ) ;
73
73
assert . strictEqual ( angleValue . radians , 100 ) ;
74
- assert . approximately ( angleValue . gradians , 6366.197724 , EPSILON ) ;
75
- assert . approximately ( angleValue . turns , 15.915494 , EPSILON ) ;
74
+ assert . closeTo ( angleValue . gradians , 6366.197724 , EPSILON ) ;
75
+ assert . closeTo ( angleValue . turns , 15.915494 , EPSILON ) ;
76
76
} ) ;
77
77
78
78
test ( 'Conversions when specified as gradians' , function ( ) {
79
79
var angleValue = new CSSAngleValue ( 215 , 'grad' ) ;
80
- assert . approximately ( angleValue . degrees , 193.5 , EPSILON ) ;
81
- assert . approximately ( angleValue . radians , 3.377212 , EPSILON ) ;
80
+ assert . closeTo ( angleValue . degrees , 193.5 , EPSILON ) ;
81
+ assert . closeTo ( angleValue . radians , 3.377212 , EPSILON ) ;
82
82
assert . strictEqual ( angleValue . gradians , 215 ) ;
83
- assert . approximately ( angleValue . turns , 0.5375 , EPSILON ) ;
83
+ assert . closeTo ( angleValue . turns , 0.5375 , EPSILON ) ;
84
84
} ) ;
85
85
86
86
test ( 'Conversions when specified as turns' , function ( ) {
87
87
var angleValue = new CSSAngleValue ( 0.6 , 'turn' ) ;
88
- assert . approximately ( angleValue . degrees , 216 , EPSILON ) ;
89
- assert . approximately ( angleValue . radians , 3.769911 , EPSILON ) ;
90
- assert . approximately ( angleValue . gradians , 240 , EPSILON ) ;
88
+ assert . closeTo ( angleValue . degrees , 216 , EPSILON ) ;
89
+ assert . closeTo ( angleValue . radians , 3.769911 , EPSILON ) ;
90
+ assert . closeTo ( angleValue . gradians , 240 , EPSILON ) ;
91
91
assert . strictEqual ( angleValue . turns , 0.6 ) ;
92
92
} ) ;
93
93
@@ -102,7 +102,7 @@ test('Parsing valid strings results in expected CSSAngleValues', function() {
102
102
var result = typedOM . internal . parsing . consumeAngleValue ( values [ i ] . str ) ;
103
103
assert . isNotNull ( result , 'Failed parsing ' + values [ i ] . str ) ;
104
104
assert . instanceOf ( result [ 0 ] , CSSAngleValue ) ;
105
- assert . approximately ( result [ 0 ] . degrees , values [ i ] . degrees , EPSILON ) ;
105
+ assert . closeTo ( result [ 0 ] . degrees , values [ i ] . degrees , EPSILON ) ;
106
106
assert . strictEqual ( result [ 0 ] . _value , values [ i ] . value ) ;
107
107
assert . strictEqual ( result [ 0 ] . _unit , values [ i ] . unit ) ;
108
108
assert . strictEqual ( result [ 0 ] . cssText , values [ i ] . cssText ) ;
@@ -120,7 +120,7 @@ test('Parsing is case insensitive', function() {
120
120
var result = typedOM . internal . parsing . consumeAngleValue ( values [ i ] . str ) ;
121
121
assert . isNotNull ( result , 'Failed parsing ' + values [ i ] . str ) ;
122
122
assert . instanceOf ( result [ 0 ] , CSSAngleValue ) ;
123
- assert . approximately ( result [ 0 ] . degrees , values [ i ] . degrees , EPSILON ) ;
123
+ assert . closeTo ( result [ 0 ] . degrees , values [ i ] . degrees , EPSILON ) ;
124
124
assert . strictEqual ( result [ 0 ] . _value , values [ i ] . value ) ;
125
125
assert . strictEqual ( result [ 0 ] . _unit , values [ i ] . unit ) ;
126
126
assert . strictEqual ( result [ 0 ] . cssText , values [ i ] . cssText ) ;
0 commit comments