From 110a2c145f2ade96ec96e15d2f2cce09a6572e6a Mon Sep 17 00:00:00 2001 From: Rich-Harris Date: Sat, 28 Nov 2015 06:36:12 -0500 Subject: [PATCH] test for #16 --- test/samples/checks/foo/.babelrc | 3 +++ test/samples/checks/foo/index.js | 1 + test/samples/checks/main.js | 3 +++ test/test.js | 13 +++++++++++++ 4 files changed, 20 insertions(+) create mode 100644 test/samples/checks/foo/.babelrc create mode 100644 test/samples/checks/foo/index.js create mode 100644 test/samples/checks/main.js diff --git a/test/samples/checks/foo/.babelrc b/test/samples/checks/foo/.babelrc new file mode 100644 index 0000000..de9f4a8 --- /dev/null +++ b/test/samples/checks/foo/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": [ "es2015" ] +} diff --git a/test/samples/checks/foo/index.js b/test/samples/checks/foo/index.js new file mode 100644 index 0000000..7a4e8a7 --- /dev/null +++ b/test/samples/checks/foo/index.js @@ -0,0 +1 @@ +export default 42; diff --git a/test/samples/checks/main.js b/test/samples/checks/main.js new file mode 100644 index 0000000..64f7ffe --- /dev/null +++ b/test/samples/checks/main.js @@ -0,0 +1,3 @@ +import foo from './foo/index.js'; + +console.log( foo ); diff --git a/test/test.js b/test/test.js index c4f05ea..72a150b 100644 --- a/test/test.js +++ b/test/test.js @@ -105,4 +105,17 @@ describe( 'rollup-plugin-babel', function () { }); }); }); + + it( 'checks config per-file', function () { + return rollup.rollup({ + entry: 'samples/checks/main.js', + plugins: [ babelPlugin() ] + }) + .then( function () { + assert.ok( false, 'promise should not fulfil' ); + }) + .catch( function ( err ) { + assert.ok( /es2015-rollup/.test( err.message ) ); + }); + }); });