Procházet zdrojové kódy

Used fs.existsSync that doesn't exists in nodejs 0.6 that is used by travis for testing.

tags/0.7.3
Daniel Fagerstrom před 13 roky
rodič
revize
3ee2574e21
1 změnil soubory, kde provedl 10 přidání a 1 odebrání
  1. +10
    -1
      test/mustache-spec-test.js

+ 10
- 1
test/mustache-spec-test.js Zobrazit soubor

@@ -41,10 +41,19 @@ var noSkip = process.env.NOSKIP;
// variable (e.g. TEST=interpolation mocha test/mustache-spec-test.js)
var fileToRun = process.env.TEST;

// Mustache should work on node 0.6 that doesn't have fs.exisisSync
function existsDir(path) {
try {
return fs.statSync(path).isDirectory();
} catch (x) {
return false;
}
}

var specFiles;
if (fileToRun) {
specFiles = [fileToRun];
} else if (fs.existsSync(specsDir)) {
} else if (existsDir(specsDir)) {
specFiles = fs.readdirSync(specsDir).filter(function (file) {
return (/\.json$/).test(file);
}).map(function (file) {


Načítá se…
Zrušit
Uložit