sindresorhus / generator-nm

Scaffold out a node module
MIT License
743 stars 82 forks source link

Hyphenated or punctuated superb descriptions cause test to fail #59

Closed radiovisual closed 8 years ago

radiovisual commented 8 years ago

As pointed out by @JonnyBurger in PR #58, there is a small chance (~5%) that the RegExp in the unit tests for the prompt description:

"My (\w)+ module"

might cause the test to fail on spaced, hyphenated or punctuated superb values like:

"awe-inspiring",
"bee's knees",
"cat's pajamas",

So I propose a slightly more generic, and forgiving RegExp like:

/My (.)+ module/

Which would future-proof itself to any other entries to the superb module that might involve punctuation or multiple words.

sindresorhus commented 8 years ago

👍