rollup-plugin-jsxbin
Version:
Plugin for rollup with covert jsx file to jsxbin
25 lines (21 loc) • 593 B
JavaScript
const rollup = require('rollup');
const jsxbin = require('..');
process.chdir(__dirname);
const testFunc = function(entry, expectedValue) {
return function() {
expect.assertions(1);
return rollup.rollup({
input: `./fixtures/${entry}.js`,
plugins: [
jsxbin()
]
}).then(function(bundle) {
return bundle.generate({ format: 'cjs' }).then(function(res) {
expectedValue(res.code).toContain(expectedValue)
})
})
}
}
describe('rollup-plugin-jsxbin', function() {
it('jsxbin the code', testFunc('test', '$.writeln("jsxbin");'))
})