Skip to content

Commit b97f2e1

Browse files
test: verify invalid style for attributesToProps throws an error
1 parent 320c364 commit b97f2e1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/attributes-to-props.js

+14
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,20 @@ describe('attributesToProps', () => {
217217
}
218218
);
219219
});
220+
221+
[Object, Array, Number, Date].forEach(type => {
222+
it(`throws an error when attributes.style=${type.name}`, () => {
223+
assert.throws(
224+
() => {
225+
attributesToProps({ style: type });
226+
},
227+
{
228+
name: 'TypeError',
229+
message: 'First argument must be a string.'
230+
}
231+
);
232+
});
233+
});
220234
});
221235

222236
describe('when utilties.PRESERVE_CUSTOM_ATTRIBUTES=false', () => {

0 commit comments

Comments
 (0)