test("Taskr.plugin (export fn params)", co(function * (t) { t.plan(3) const taskr = yield cli.spawn(altDir) taskr.tasks = { foo: { data: [], func: co(function * (f) { yield f.localPlugin({ t }) }) } } yield taskr.start("foo") }))
test("cli.spawn", co(function * (t) { const alt = join(fixtures, "alt") const taskfile = join(alt, "taskfile.js") const f = yield cli.spawn(alt) t.true(f instanceof Taskr, "via dir; spawns Taskr") t.equal(f.file, taskfile, "via dir; finds taskfile") t.true($.isObject(f.tasks) && "a" in f.tasks, "via dir; loads Taskr tasks (obj)") t.equal(Object.keys(f.plugins).length, 3, "via dir; found all VALID plugins") t.true($.isObject(f.plugins), "via dir; loads Taskr plugins (obj)") const t1 = yield cli.spawn() t.true(t1 instanceof Taskr, "via `null` still spawns Taskr") t.equal(t1.file, undefined, "via `null` but without a taskfile") const t2 = yield cli.spawn("/fake12312") t.equal(t2.file, undefined, "fake directory no `taskr.file` attached") t.end() }))
const taskr = yield cli.spawn(o.cwd); reporter.call(taskr);
test("Taskr.plugins (auto-load)", co(function* (t) { t.plan(7) const taskr = yield cli.spawn(altDir)