From b2ec15accc5da6fd3e27a487947abc6c85452015 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Fri, 30 Jan 2015 18:04:28 +1100 Subject: [PATCH] allow test options to be plain javascript files --- test/_helper.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/_helper.js b/test/_helper.js index 9af79a4e37..2c27598074 100644 --- a/test/_helper.js +++ b/test/_helper.js @@ -1,3 +1,4 @@ +var util = require("../lib/6to5/util"); var path = require("path"); var fs = require("fs"); var _ = require("lodash"); @@ -34,8 +35,8 @@ exports.get = function (entryName, entryLoc) { }; suites.push(suite); - var suiteOptsLoc = suite.filename + "/options.json"; - if (fs.existsSync(suiteOptsLoc)) suite.options = require(suiteOptsLoc); + var suiteOptsLoc = util.resolve(suite.filename + "/options"); + if (suiteOptsLoc) suite.options = require(suiteOptsLoc); if (fs.statSync(suite.filename).isFile()) { push(suiteName, suite.filename); @@ -71,8 +72,8 @@ exports.get = function (entryName, entryLoc) { sourceMapName: expectLocAlias }, _.cloneDeep(suite.options)); - var taskOptsLoc = taskDir + "/options.json"; - if (fs.existsSync(taskOptsLoc)) _.merge(taskOpts, require(taskOptsLoc)); + var taskOptsLoc = util.resolve(taskDir + "/options"); + if (taskOptsLoc) _.merge(taskOpts, require(taskOptsLoc)); var test = { title: humanise(taskName, true),