Skip to content

Commit

Permalink
getTestTemplate fix
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Miroku87 committed Apr 11, 2017
1 parent 704d289 commit 9c07c65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/preprocess.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ function processIncludeDirective(isStatic, context, opts, match, linePrefix, fil

function getTestTemplate(test) {
/*jshint evil:true*/
test = test || 'true';
test = typeof test === 'undefined' || test === "" || test === null || /\s+/.test(test) ? "true" : test;
test = test.trim();

// force single equals replacement
Expand Down

0 comments on commit 9c07c65

Please sign in to comment.