mirror of
https://github.com/stolksdorf/homebrewery.git
synced 2025-12-21 19:01:28 +00:00
Stubbing out test files
This commit is contained in:
@@ -9,7 +9,8 @@
|
|||||||
"phb": "node scripts/phb.js",
|
"phb": "node scripts/phb.js",
|
||||||
"prod": "set NODE_ENV=production&& npm run build",
|
"prod": "set NODE_ENV=production&& npm run build",
|
||||||
"postinstall": "npm run build",
|
"postinstall": "npm run build",
|
||||||
"start": "node server.js"
|
"start": "node server.js",
|
||||||
|
"test": "mocha --recursive test"
|
||||||
},
|
},
|
||||||
"author": "stolksdorf",
|
"author": "stolksdorf",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
0
test/brew.datatest.js
Normal file
0
test/brew.datatest.js
Normal file
1
test/config/testing.json
Normal file
1
test/config/testing.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
29
test/test.init.js
Normal file
29
test/test.init.js
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
|
||||||
|
// initialize config
|
||||||
|
const config = require('nconf')
|
||||||
|
.argv()
|
||||||
|
.env({ lowerCase: true })
|
||||||
|
.file('testing', { file: `./config/testing.json` })
|
||||||
|
.file('environment', { file: `../config/${process.env.NODE_ENV}.json` })
|
||||||
|
.file('defaults', { file: '../config/default.json' });
|
||||||
|
|
||||||
|
// other libs
|
||||||
|
const should = require('chai').use(require('chai-as-promised')).should();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
config: config,
|
||||||
|
should: should,
|
||||||
|
clearCache: () => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
Cache.getRawClientYesIKnowWhatImDoing()
|
||||||
|
.flushdb((err) => {
|
||||||
|
if (err) {
|
||||||
|
return reject(new Error(err));
|
||||||
|
}
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user