File tree Expand file tree Collapse file tree 1 file changed +22
-10
lines changed
Expand file tree Collapse file tree 1 file changed +22
-10
lines changed Original file line number Diff line number Diff line change @@ -167,18 +167,30 @@ main() {
167167 );
168168 });
169169
170- test ('throws when passed a CSS value string with a unit other than px/rem' , () {
171- expect (() => toPx ('1em' ), allOf (
172- throwsArgumentError,
173- throwsA (hasToStringValue (contains ('must be a rem num or a String px/rem value' ))))
174- );
170+ group ('throws when passed a CSS value string with a unit other than px/rem' , () {
171+ test ('' , () {
172+ expect (() => toPx ('1em' ), allOf (
173+ throwsArgumentError,
174+ throwsA (hasToStringValue (contains ('must be a rem num or a String px/rem value' ))))
175+ );
176+ });
177+
178+ test ('unless `passThroughUnsupportedUnits` is true' , () {
179+ expect (toPx ('1em' , passThroughUnsupportedUnits: true ), new CssValue .parse ('1em' ));
180+ });
175181 });
176182
177- test ('throws when passed a CssValue instance with a unit other than px/rem' , () {
178- expect (() => toPx (new CssValue .parse ('1em' )), allOf (
179- throwsArgumentError,
180- throwsA (hasToStringValue (contains ('must be a rem num or a String px/rem value' ))))
181- );
183+ group ('throws when passed a CssValue instance with a unit other than px/rem' , () {
184+ test ('' , () {
185+ expect (() => toPx (new CssValue .parse ('1em' )), allOf (
186+ throwsArgumentError,
187+ throwsA (hasToStringValue (contains ('must be a rem num or a String px/rem value' ))))
188+ );
189+ });
190+
191+ test ('unless `passThroughUnsupportedUnits` is true' , () {
192+ expect (toPx (new CssValue .parse ('1em' ), passThroughUnsupportedUnits: true ), new CssValue .parse ('1em' ));
193+ });
182194 });
183195 });
184196
You can’t perform that action at this time.
0 commit comments