test('@taskr/unflow (sourceMap:`external`)', t => { t.plan(1); create({ *foo(f) { const tmp = tmpDir('tmp-4'); yield f.source(`${dir}/*.js`).unflow({ sourceMap:'external' }).target(tmp); const str = yield f.$.read(`${tmp}/foo.js`, 'utf8'); t.true(/sourceMappingURL=foo.js.map/.test(str), 'attach an `external` sourceMap link'); yield f.clear(tmp); } }).start('foo'); });
test('@taskr/rev (all)', t => { t.plan(3); const taskr = create({ *foo(f) { t.true('rev' in taskr.plugins, 'attach `rev()` plugin to taskr'); t.true('revManifest' in taskr.plugins, 'attach `revManifest()` plugin to taskr'); t.true('revReplace' in taskr.plugins, 'attach `revReplace()` plugin to taskr'); } }); taskr.start('foo'); });
test('@taskr/unflow (sourceMap:`inline`)', t => { t.plan(1); create({ *foo(f) { const tmp = tmpDir('tmp-3'); yield f.source(`${dir}/*.js`).unflow({sourceMap: 'inline'}).target(tmp); const str = yield f.$.read(`${tmp}/foo.js`, 'utf8'); t.true(/sourceMappingURL=data:application/.test(str), 'attach an `inline` sourceMap'); yield f.clear(tmp); } }).start('foo'); });
test('@taskr/unflow (sourceMap:`inline`)', t => { t.plan(1); create({ *foo(f) { const tmp = tmpDir('tmp-3'); yield f.source(`${dir}/*.js`).unflow({sourceMap: 'inline'}).target(tmp); const str = yield f.$.read(`${tmp}/foo.js`, 'utf8'); t.true(/sourceMappingURL=data:application/.test(str), 'attach an `inline` sourceMap'); yield f.clear(tmp); } }).start('foo'); });