diff --git a/test/test-REST-requests.js b/test/test-REST-requests.js index 569a119..08330d2 100644 --- a/test/test-REST-requests.js +++ b/test/test-REST-requests.js @@ -8,7 +8,7 @@ describe("REST requests", function () { if (~modName.indexOf('formage') || ~modName.indexOf('mongoose') || ~modName.indexOf('jugglingdb')) delete require.cache[modName]; }); - var formage = require('../index'); + var formage = require('../'); var mongoose = ctx.mongoose = require("mongoose"); var conn_str = 'mongodb://localhost/formage-test' + this.test.parent.title.replace(/\s/g, ''); mongoose.connect(conn_str, function (err) { @@ -74,7 +74,7 @@ describe("REST requests", function () { delete require.cache[modName]; }); require('tungus'); - var formage = require('../index'); + var formage = require('../'); var mongoose = ctx.mongoose = require("mongoose"); var conn_str = 'tingodb://./.data/RESTontingodb'; mongoose.connect(conn_str, function (err) { diff --git a/test/test-edge-cases.js b/test/test-edge-cases.js index 32b5498..fc67b9e 100644 --- a/test/test-edge-cases.js +++ b/test/test-edge-cases.js @@ -6,7 +6,7 @@ describe("edge cases on mongoose", function () { if (~modName.indexOf('formage') || ~modName.indexOf('mongoose') || ~modName.indexOf('jugglingdb')) delete require.cache[modName]; }); - this.formage = require('../index'); + this.formage = require('../'); var mongoose = this.mongoose = require("mongoose"); this.express = require('express'); var conn_str = 'mongodb://localhost/formage-test' + this.test.parent.title.replace(/\s/g, ''); diff --git a/test/test-misc.js b/test/test-misc.js index 7ea5f2d..a3010dd 100644 --- a/test/test-misc.js +++ b/test/test-misc.js @@ -7,7 +7,7 @@ describe("misc requests on mongoose", function () { if (~modName.indexOf('formage') || ~modName.indexOf('mongoose') || ~modName.indexOf('jugglingdb')) delete require.cache[modName]; }); - var formage = require('../index'); + var formage = require('../'); var mongoose = ctx.mongoose = require("mongoose"); var conn_str = 'mongodb://localhost/formage-test' + this.test.parent.title.replace(/\s/g, ''); mongoose.connect(conn_str, function (err) { diff --git a/utils/CompileTempletes.js b/utils/CompileTempletes.js index 44abaec..5aa289b 100644 --- a/utils/CompileTempletes.js +++ b/utils/CompileTempletes.js @@ -34,4 +34,6 @@ jadeFiles.forEach(function(file) { } }); console.log('\x1B[36mformage\x1B[39m: compiled %d templates', jadeFiles.length); -fs.writeFileSync(path.join(__dirname, '..', 'generated', 'templates.js'), js); +var genDir = path.join(__dirname, '..', 'generated'); +if (!fs.existsSync(genDir)) fs.mkdirSync(genDir); +fs.writeFileSync(path.join(genDir, 'templates.js'), js);