update to state of the art

This commit is contained in:
s2
2020-10-10 15:18:01 +02:00
parent cf251a170f
commit 4cdcfd167c
1526 changed files with 48132 additions and 7268 deletions

View File

@@ -90,7 +90,7 @@ suite('fileTask', function () {
exec('mkdir -p ./foo');
fs.writeFileSync('foo/prereq.txt', prereqData);
let out;
out =exec('./node_modules/.bin/jake -q fileTest:foo/from-prereq.txt').toString().trim();
out = exec('./node_modules/.bin/jake -q fileTest:foo/from-prereq.txt').toString().trim();
assert.equal('fileTest:foo/from-prereq.txt task', out);
let data = fs.readFileSync(process.cwd() + '/foo/from-prereq.txt');
assert.equal(prereqData, data.toString());

View File

@@ -12,6 +12,11 @@ task({'noAction': ['default']});
desc('No action, no prereqs.');
task('noActionNoPrereqs');
desc('Top-level zerbofrangazoomy task');
task('zerbofrangazoomy', function () {
console.log('Whaaaaaaaa? Ran the zerbofrangazoomy task!')
});
desc('Task that throws');
task('throwy', function () {
let errorListener = function (err) {

View File

@@ -23,6 +23,13 @@ suite('taskBase', function () {
exec('./node_modules/.bin/jake noActionNoPrereqs');
});
test('a task that exists at the top-level, and not in the specified namespace, should error', function () {
let res = require('child_process').spawnSync('./node_modules/.bin/jake',
['asdfasdfasdf:zerbofrangazoomy']);
let err = res.stderr.toString();
assert.ok(err.indexOf('Unknown task' > -1));
});
test('passing args to a task', function () {
let out = exec('./node_modules/.bin/jake -q argsEnvVars[foo,bar]').toString().trim();
let parsed = h.parse(out);

View File

@@ -68,4 +68,10 @@ suite('namespace', function () {
assert.ok(task.action.toString().indexOf('zooby:frang:w00t:bar') > -1);
});
test('resolution miss with throw error', function () {
let curr = Namespace.ROOT_NAMESPACE;
let task = curr.resolveTask('asdf:qwer');
assert.ok(!task);
});
});