Skip to content

Commit

Permalink
add test for #1606
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Sep 8, 2017
1 parent 604fdda commit c90b01e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/cli/index.js
Expand Up @@ -100,6 +100,13 @@ describe('cli', () => {
} catch (err) {
done(err);
}
} else if (config.test) {
try {
config.test();
done();
} catch (err) {
done(err);
}
} else if (
sander.existsSync('_expected') &&
sander.statSync('_expected').isDirectory()
Expand Down
12 changes: 12 additions & 0 deletions test/cli/samples/config-no-output/_config.js
@@ -0,0 +1,12 @@
var fs = require('fs');
var assert = require('assert');

module.exports = {
description: 'uses -o from CLI',
command: 'rollup -c -o output.js',
test() {
const output = fs.readFileSync('output.js', 'utf-8');
assert.equal(output.trim(), 'console.log(42);');
fs.unlinkSync('output.js');
}
};
1 change: 1 addition & 0 deletions test/cli/samples/config-no-output/main.js
@@ -0,0 +1 @@
console.log(42);
6 changes: 6 additions & 0 deletions test/cli/samples/config-no-output/rollup.config.js
@@ -0,0 +1,6 @@
export default {
input: 'main.js',
output: {
format: 'es'
}
};

0 comments on commit c90b01e

Please sign in to comment.