@@ -57,33 +57,38 @@ suite('Inline StylePropertyMap', function() {
5757 var inlineStyleMap = this . element . styleMap ( ) ;
5858 var valueSequence = [ new CSSSimpleLength ( 3 , 'px' ) , new CSSSimpleLength ( 6 , 'px' ) ] ;
5959
60- assert . throw ( function ( ) { inlineStyleMap . set ( 'height' , valueSequence ) } , TypeError , 'height does not support sequences of styleValues' ) ;
60+ assert . throws ( function ( ) { inlineStyleMap . set ( 'height' , valueSequence ) } , TypeError ,
61+ / ^ h e i g h t d o e s n o t s u p p o r t s e q u e n c e s o f s t y l e V a l u e s $ / ) ;
6162 } ) ;
6263
6364 test ( 'Set should throw a TypeError if a non CSSKeywordValue CSSStyleValue unsupported by the CSS style property is set' , function ( ) {
6465 var inlineStyleMap = this . element . styleMap ( ) ;
6566 var numberValue = new CSSNumberValue ( 42 ) ;
6667
67- assert . throw ( function ( ) { inlineStyleMap . set ( 'height' , numberValue ) } , TypeError ) ;
68+ assert . throws ( function ( ) { inlineStyleMap . set ( 'height' , numberValue ) } , TypeError ,
69+ / ^ h e i g h t d o e s n o t t a k e v a l u e s o f t y p e C S S N u m b e r V a l u e $ / ) ;
6870 } ) ;
6971
7072 test ( 'Set should throw a TypeError if a CSSKeywordValue unsupported by the CSS style property is set ' , function ( ) {
7173 var inlineStyleMap = this . element . styleMap ( ) ;
7274 var keyword = new CSSKeywordValue ( 'lemon' ) ;
7375
74- assert . throw ( function ( ) { inlineStyleMap . set ( 'height' , keyword ) } , 'height does not take the keyword lemon' ) ;
76+ assert . throws ( function ( ) { inlineStyleMap . set ( 'height' , keyword ) } ,
77+ / ^ h e i g h t d o e s n o t t a k e t h e k e y w o r d l e m o n $ / ) ;
7578 } ) ;
7679
7780 test ( 'Set should throw a TypeError if a non CSSStyleValue is inputed into the function' , function ( ) {
7881 var inlineStyleMap = this . element . styleMap ( ) ;
7982
80- assert . throw ( function ( ) { inlineStyleMap . set ( 'height' , 4 ) } , TypeError ) ;
83+ assert . throws ( function ( ) { inlineStyleMap . set ( 'height' , 4 ) } , TypeError ,
84+ / ^ h e i g h t d o e s n o t t a k e v a l u e s o f t y p e N u m b e r $ / ) ;
8185 } ) ;
8286
8387 test ( 'Set should throw a TypeError if an unsupported property is inputed into the function' , function ( ) {
8488 var inlineStyleMap = this . element . styleMap ( ) ;
8589
86- assert . throw ( function ( ) { inlineStyleMap . set ( 'lemons' , new CSSSimpleLength ( 3 , 'px' ) ) } , TypeError ) ;
90+ assert . throws ( function ( ) { inlineStyleMap . set ( 'lemons' , new CSSSimpleLength ( 3 , 'px' ) ) } , TypeError ,
91+ / ^ C a n n o t s e t l e m o n s b e c a u s e i t i s n o t a s u p p o r t e d C S S p r o p e r t y $ / ) ;
8792 } ) ;
8893
8994 test ( 'The delete method clears a given property' , function ( ) {
@@ -97,7 +102,8 @@ suite('Inline StylePropertyMap', function() {
97102 test ( 'The delete method should throw a TypeError if an unsupported property' , function ( ) {
98103 var inlineStyleMap = this . element . styleMap ( ) ;
99104
100- assert . throw ( function ( ) { inlineStyleMap . delete ( 'lemons' ) } , TypeError ) ;
105+ assert . throws ( function ( ) { inlineStyleMap . delete ( 'lemons' ) } , TypeError ,
106+ / ^ C a n n o t d e l e t e l e m o n s b e c a u s e i t i s n o t a s u p p o r t e d C S S p r o p e r t y $ / ) ;
101107 } ) ;
102108
103109 test ( 'The has method will return true if the valid CSS property input has been assigned a value' +
@@ -111,7 +117,8 @@ suite('Inline StylePropertyMap', function() {
111117 test ( 'The has method should throw a TypeError if an unsupported property' , function ( ) {
112118 var inlineStyleMap = this . element . styleMap ( ) ;
113119
114- assert . throw ( function ( ) { inlineStyleMap . has ( 'lemons' ) } , TypeError ) ;
120+ assert . throws ( function ( ) { inlineStyleMap . has ( 'lemons' ) } , TypeError ,
121+ / ^ C a n n o t u s e h a s m e t h o d f o r l e m o n s b e c a u s e i t i s n o t a s u p p o r t e d C S S p r o p e r t y $ / ) ;
115122 } ) ;
116123
117124 test ( 'The append method should successfully append a supported CSSStyleValue to a property ' +
@@ -149,29 +156,29 @@ suite('Inline StylePropertyMap', function() {
149156 var valueSequence = [ new CSSNumberValue ( 4 ) , new CSSNumberValue ( 5 ) , new CSSSimpleLength ( 3 , 'px' ) , new CSSKeywordValue ( 'infinite' ) ] ;
150157 this . element . style [ 'animation-iteration-count' ] = 'infinite, 2, 5' ;
151158
152- assert . throw ( function ( ) { inlineStyleMap . append ( 'animation-iteration-count' , valueSequence ) } , TypeError ,
153- ' animation-iteration-count does not take values of type CSSSimpleLength' ) ;
159+ assert . throws ( function ( ) { inlineStyleMap . append ( 'animation-iteration-count' , valueSequence ) } , TypeError ,
160+ / ^ a n i m a t i o n - i t e r a t i o n - c o u n t d o e s n o t t a k e v a l u e s o f t y p e C S S S i m p l e L e n g t h $ / ) ;
154161 } ) ;
155162
156163 test ( 'The append method should throw a TypeError when an unsupported CSS property is entered' , function ( ) {
157164 var inlineStyleMap = this . element . styleMap ( ) ;
158165
159- assert . throw ( function ( ) { inlineStyleMap . append ( 'lemon' , new CSSNumberValue ( 4 ) ) } , TypeError ,
160- ' lemon is not a supported CSS property' ) ;
166+ assert . throws ( function ( ) { inlineStyleMap . append ( 'lemon' , new CSSNumberValue ( 4 ) ) } , TypeError ,
167+ / ^ l e m o n i s n o t a s u p p o r t e d C S S p r o p e r t y $ / ) ;
161168 } ) ;
162169
163170 test ( 'The append method should throw a TypeError when a CSS property that does not support list values is entered' , function ( ) {
164171 var inlineStyleMap = this . element . styleMap ( ) ;
165172
166- assert . throw ( function ( ) { inlineStyleMap . append ( 'height' , new CSSNumberValue ( 4 ) ) } , TypeError ,
167- ' height does not support sequences of styleValues' ) ;
173+ assert . throws ( function ( ) { inlineStyleMap . append ( 'height' , new CSSNumberValue ( 4 ) ) } , TypeError ,
174+ / ^ h e i g h t d o e s n o t s u p p o r t s e q u e n c e s o f s t y l e V a l u e s $ / ) ;
168175 } ) ;
169176
170177 test ( 'The append method should throw a TypeError when null is entered as the value' , function ( ) {
171178 var inlineStyleMap = this . element . styleMap ( ) ;
172179
173- assert . throw ( function ( ) { inlineStyleMap . append ( 'animation-iteration-count' , null ) } , TypeError ,
174- ' null cannot be appended to CSS properties' ) ;
180+ assert . throws ( function ( ) { inlineStyleMap . append ( 'animation-iteration-count' , null ) } , TypeError ,
181+ / ^ n u l l c a n n o t b e a p p e n d e d t o C S S p r o p e r t i e s $ / ) ;
175182 } ) ;
176183
177184 test ( 'getProperties returns an ordered list of properties that have been set on an element' , function ( ) {
0 commit comments