diff --git a/examples/custom_adapter/testem.json b/examples/custom_adapter/testem.json new file mode 100644 index 000000000..4681d6338 --- /dev/null +++ b/examples/custom_adapter/testem.json @@ -0,0 +1,3 @@ +{ + "framework": "custom" +} \ No newline at end of file diff --git a/examples/custom_adapter/testem.yml b/examples/custom_adapter/testem.yml deleted file mode 100644 index 8b0aed91c..000000000 --- a/examples/custom_adapter/testem.yml +++ /dev/null @@ -1 +0,0 @@ -framework: custom \ No newline at end of file diff --git a/examples/mocha_simple/testem.json b/examples/mocha_simple/testem.json new file mode 100644 index 000000000..70c77d12c --- /dev/null +++ b/examples/mocha_simple/testem.json @@ -0,0 +1,3 @@ +{ + "framework": "mocha" +} \ No newline at end of file diff --git a/examples/mocha_simple/testem.yml b/examples/mocha_simple/testem.yml deleted file mode 100644 index 1e1482bfd..000000000 --- a/examples/mocha_simple/testem.yml +++ /dev/null @@ -1 +0,0 @@ -framework: mocha \ No newline at end of file diff --git a/lib/config.js b/lib/config.js index f6ef473a1..aabca3048 100644 --- a/lib/config.js +++ b/lib/config.js @@ -18,11 +18,20 @@ function Config(progOptions){ Config.prototype.read = function(callback){ var configFile = this.progOptions.file , self = this - fs.readFile(configFile, function(err, data){ - if (!err){ - var cfg = yaml.load(String(data)) - self.config = cfg + , jsonConfigFile = configFile.replace(/\.yml$/, ".json") + + fs.readFile(configFile, function (err, data) { + if (err) { + return fs.readFile(jsonConfigFile, function (err, data) { + if (!err) { + var cfg = JSON.parse(data.toString()) + self.config = cfg + } + if (callback) callback.call(self) + }) } + var cfg = yaml.load(String(data)) + self.config = cfg if (callback) callback.call(self) }) }