Skip to content

Commit

Permalink
fix error in hasClass when className is reqexp
Browse files Browse the repository at this point in the history
  • Loading branch information
alvteren committed Mar 18, 2019
1 parent 27ea407 commit b12e336
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/enzyme/src/ShallowWrapper.js
Expand Up @@ -1253,7 +1253,7 @@ class ShallowWrapper {
* @returns {Boolean}
*/
hasClass(className) {
if (className && className.indexOf('.') !== -1) {
if (typeof className === 'string' && className.indexOf('.') !== -1) {
// eslint-disable-next-line no-console
console.warn('It looks like you\'re calling `ShallowWrapper::hasClass()` with a CSS selector. hasClass() expects a class name, not a CSS selector.');
}
Expand Down

0 comments on commit b12e336

Please sign in to comment.