jsoverson / preprocess

Preprocess HTML, JavaScript, and other files with directives based off custom or ENV configuration
Other
366 stars 80 forks source link

getTestTemplate causing Expected () to start arrow function, but got ';' instead of '=>' ` warning #125

Open Miroku87 opened 7 years ago

Miroku87 commented 7 years ago

Modified the getTestTemplate function. The check for test availability wasn't accurate enough. var || 'default' does not cover a lot of episodes. Infact I was getting an Expected () to start arrow function, but got ';' instead of '=>' warning because test was a series of blank spaces so it wasn't undefined so it wasn't been converted in true and the trim would transform it in an empty string. Lately return (); threw the warning.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 97.571% when pulling 9c07c65d9d0719812f9c6dd6f257d9890ec21802 on Miroku87:patch-1 into 704d28987837f38abcd6b2e07ba65928e43f2983 on jsoverson:master.

Miroku87 commented 7 years ago

I've just noticed that the last check with the RegExp should be like this /^\s+$/.test(test)