Skip to content

Instantly share code, notes, and snippets.

@agneym
Last active February 7, 2018 15:05
Show Gist options
  • Save agneym/0a1e2c7dc4671735504912f83b44cf67 to your computer and use it in GitHub Desktop.
Save agneym/0a1e2c7dc4671735504912f83b44cf67 to your computer and use it in GitHub Desktop.
Convert hasClass to classes() codemod.
codemod "expect\((.*?)\.hasClass\(('.*?')\)\)\.to\.equal\(true\)" 'expect(\1.classes()).to.include(\2)'
codemod "expect\((.*?)\.hasClass\(('.*?')\)\)\.to\.equal\(false\)" 'expect(\1.classes()).to.not.include(\2)'
codemod "expect\((.*?)\.hasAttribute\(('.*?'),('.*?')\)\)\.to\.equal\(true\);" ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment