You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There isn't really a straightforward built-in way to do that right now, but that is a feature that's being looked into. See #31. That's on my short list of things to do once I get some breathing room, and I think a test runner of some sort would be one of the first transforms to get added.
You can accomplish this now by writing a transform that runs the tests and bails if the tests fail. Then for your final target, gobble the test step as well. Roughly:
varsrc=gobble('sources').transform('compile-or-whatever');// test can affect the build, but it doesn't pass any of its files on - only gets run when src or 'tests' changesvartest=gobble([src,gobble('tests')]).transform((indir,outdir,options,done)=>{varmocha=newMocha({ ... });returnthis.sander.lsr(indir,'tests').then(files=>files.forEach(f=>mocha.addFile(f))).then(()=>{mocha.run(errs=>if(errs>0)thrownewError('Tests failed'))});});module.exports=gobble([src,test]);
Is there a way to run mocha tests within Gobble? So a build would re-run tests when changes happened.
The text was updated successfully, but these errors were encountered: