Skip to content

Commit

Permalink
[feat] Update test to run with base folder
Browse files Browse the repository at this point in the history
  • Loading branch information
icfr committed Sep 22, 2016
1 parent ca054c9 commit 9a3159a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
5 changes: 5 additions & 0 deletions test/Commands/testInit.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ module.exports = {
chdir: appdir + '/'
});
app.config = rewire('../../bootstrap/config')();
app.config.laravel.addToApp = {
job: {
example: "example"
}
};
app.configure(function configureApp() {
app.use(shell.router({
shell: app
Expand Down
6 changes: 3 additions & 3 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
var path = require('path');
var jsdiff = require('diff');
var colors = require('colors');
global.appdir = path.resolve(__dirname, './data/app_fake');
global.appdir = path.resolve(__dirname, '../data/base');
var each = require('lodash/each');
require('../bootstrap');

module.exports = {
'test send mail': require('./lib/testSendMail'),
'test history plugins': require('./shell/plugins/testHistory'),
'test help plugins': require('./shell/plugins/testHelp'),
'test init': require('./Commands/testInit'),
'test models creator': require('./Commands/testModelsCreator'),
'test make command': require('./Commands/testMakeCommand'),
'test init database': require('./bootstrap/testInitDatabase'),
'test Missing Job': require('./Commands/testMissingJob')
'test Missing Job': require('./Commands/testMissingJob'),
'test send mail': require('./lib/testSendMail')
}

global.getDiff = function getDiff(base, other) {
Expand Down
9 changes: 6 additions & 3 deletions test/scripts/clean.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash
BASEDIR=$(realpath ./)
# find "${BASEDIR}/test/data/app_fake/Config/" -type f ! -regex ".*/\(laravel.js\|core.js\|.gitignore\)" -exec rm {} \;
find "${BASEDIR}/test/data/app_fake/Jobs/" -type f ! -regex ".*/\(laravel.js\|core.js\|.gitignore\)" -exec rm {} \;
find "${BASEDIR}/test/data/app_fake/Commands/" -type f ! -regex ".*/\(laravel.js\|core.js\|.gitignore\)" -exec rm {} \;
find "${BASEDIR}/data/base/Config/" -type f ! -regex ".*/\(laravel.js\|core.js\|.gitignore\)" -exec rm {} \;
find "${BASEDIR}/data/base/Jobs/" -type f ! -regex ".*/\(readme\)" -exec rm {} \;
find "${BASEDIR}/data/base/Commands/" -type f ! -regex ".*/\(readme\)" -exec rm {} \;
find "${BASEDIR}/data/base/resources/langs/" -type f ! -regex ".*/\(readme\)" -exec rm {} \;
rm -Rf "${BASEDIR}/data/base/ModelsNew"
rm -f "${BASEDIR}/data/base/Models/User.js"

0 comments on commit 9a3159a

Please sign in to comment.