From 9c07c65d9d0719812f9c6dd6f257d9890ec21802 Mon Sep 17 00:00:00 2001 From: Andrea Date: Tue, 11 Apr 2017 15:53:02 +0200 Subject: [PATCH] getTestTemplate fix 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. --- lib/preprocess.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/preprocess.js b/lib/preprocess.js index e401d29..1e37632 100644 --- a/lib/preprocess.js +++ b/lib/preprocess.js @@ -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