justinsisley/Jest-CSS-Modules

Regex expression is incorrect

jseminck opened this issue · 3 comments

I'm no regex expert, so please correct me if I am wrong.

The current regex for me filtered out files names that ended in: myTest.spec.js. It was matching the .s part. I changed the regex to the following to make it work.

if (filename.match(/.*\.\(css\|less|scss|styl\)/)) {
   return '';
}

Could you submit a PR for this change?

Confirming the issue - the regexp as found in npm package excludes any files containing a dot followed by c, s, l, e, t, y or l. In particular a file name like "foo.test.js" has a dot followed by t and would be excluded, "foo.spec.js" has a dot followed by s.

00339d7 has the fix, please release a new version to npm.

Updated version and published to NPM.