mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2024-11-25 09:50:11 +00:00
Remove spawn-watch.
No longer necessary.
This commit is contained in:
parent
d878270bc6
commit
9466a8c0dd
@ -1,22 +0,0 @@
|
||||
/**
|
||||
@module spawn-watch.js
|
||||
*/
|
||||
|
||||
(function() {
|
||||
|
||||
// Catch various out-of-band child process errors such as ENOENT for PDFs
|
||||
// http://stackoverflow.com/q/27688804
|
||||
var SpawnWatcher = module.exports = function() {
|
||||
var childProcess = require("child_process");
|
||||
var oldSpawn = childProcess.spawn;
|
||||
childProcess.spawn = function() {
|
||||
return oldSpawn.apply(this, arguments)
|
||||
.on('error', function(err) {
|
||||
require('./error-handler').err( err, false );
|
||||
});
|
||||
};
|
||||
}();
|
||||
|
||||
//SpawnWatcher();
|
||||
|
||||
}());
|
@ -10,8 +10,7 @@
|
||||
|
||||
|
||||
|
||||
var SPAWNW = require('./core/spawn-watch')
|
||||
, HMR = require( './hackmyapi')
|
||||
var HMR = require( './hackmyapi')
|
||||
, PKG = require('../package.json')
|
||||
, FS = require('fs')
|
||||
, EXTEND = require('./utils/extend')
|
||||
|
69
test/test-stdout.js
Normal file
69
test/test-stdout.js
Normal file
@ -0,0 +1,69 @@
|
||||
var chai = require('chai')
|
||||
, expect = chai.expect
|
||||
, HMRMAIN = require('../src/main')
|
||||
, CHALK = require('chalk')
|
||||
, _ = require('underscore');
|
||||
|
||||
// Disable colors for easier output testing
|
||||
CHALK.enabled = false;
|
||||
|
||||
describe('Testing Ouput interface', function () {
|
||||
|
||||
var gather = '';
|
||||
var ConsoleLogOrg = console.log;
|
||||
|
||||
function MyConsoleLog( msg ) {
|
||||
gather += msg;
|
||||
ConsoleLogOrg.apply(this, arguments);
|
||||
}
|
||||
|
||||
function HackMyResumeStub( args ) {
|
||||
|
||||
try {
|
||||
args.unshift( process.argv[1] );
|
||||
args.unshift( process.argv[0] );
|
||||
var HMRMAIN = require('../src/main');
|
||||
HMRMAIN( args );
|
||||
}
|
||||
catch( ex ) {
|
||||
require('../src/core/error-handler').err( ex, false );
|
||||
}
|
||||
}
|
||||
|
||||
function run( title, args, tests ) {
|
||||
it( title, function() {
|
||||
gather = '';
|
||||
console.log = MyConsoleLog;
|
||||
HackMyResumeStub( args );
|
||||
console.log = ConsoleLogOrg;
|
||||
expect(
|
||||
_.all( tests, function(t) {
|
||||
return gather.indexOf(t) > -1;
|
||||
})
|
||||
).to.equal(true);
|
||||
});
|
||||
}
|
||||
|
||||
var title = '*** HackMyResume v1.5.2 ***';
|
||||
var feedMe = 'Please feed me a resume in FRESH or JSON Resume format.';
|
||||
|
||||
run('HMR should output a help string when no command is specified',
|
||||
[], [ title, 'Please give me a command (BUILD, ANALYZE, VALIDATE, CONVERT, or NEW).' ]);
|
||||
|
||||
run('BUILD should output a tip when no source is specified',
|
||||
['build'], [ title, feedMe ]);
|
||||
|
||||
run('VALIATE should output a tip when no source is specified',
|
||||
['validate'], [ title, feedMe ]);
|
||||
|
||||
run('ANALYZE should output a tip when no source is specified',
|
||||
['analyze'], [ title, feedMe ]);
|
||||
|
||||
run('CONVERT should output a tip when no source is specified',
|
||||
['convert'], [ title, feedMe ]);
|
||||
|
||||
run('NEW should output a tip when no source is specified',
|
||||
['new'], [ title, 'Please specify the filename of the resume to create.' ]);
|
||||
|
||||
|
||||
});
|
@ -1,6 +1,5 @@
|
||||
|
||||
var SPAWNWATCHER = require('../src/core/spawn-watch')
|
||||
, chai = require('chai')
|
||||
var chai = require('chai')
|
||||
, expect = chai.expect
|
||||
, should = chai.should()
|
||||
, path = require('path')
|
||||
|
Loading…
Reference in New Issue
Block a user