From bd2b15fc4143a5d54ee7a13c75b6420de9122f0d Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sat, 3 Jun 2017 14:51:21 -0400 Subject: [PATCH] add a watch option --- src/rollup.js | 3 ++- test/function/watch-option/_config.js | 6 ++++++ test/function/watch-option/main.js | 1 + test/test.js | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 test/function/watch-option/_config.js create mode 100644 test/function/watch-option/main.js diff --git a/src/rollup.js b/src/rollup.js index f366848dbd1..a017e9346a1 100644 --- a/src/rollup.js +++ b/src/rollup.js @@ -39,7 +39,8 @@ const ALLOWED_KEYS = [ 'sourceMapFile', 'targets', 'treeshake', - 'useStrict' + 'useStrict', + 'watch' ]; function checkOptions ( options ) { diff --git a/test/function/watch-option/_config.js b/test/function/watch-option/_config.js new file mode 100644 index 00000000000..f5399ef9a08 --- /dev/null +++ b/test/function/watch-option/_config.js @@ -0,0 +1,6 @@ +module.exports = { + description: 'expects watch option', + options: { + watch: {} + } +}; \ No newline at end of file diff --git a/test/function/watch-option/main.js b/test/function/watch-option/main.js new file mode 100644 index 00000000000..de87bba6701 --- /dev/null +++ b/test/function/watch-option/main.js @@ -0,0 +1 @@ +assert.ok(true); \ No newline at end of file diff --git a/test/test.js b/test/test.js index f3db159c38c..d59454e73ba 100644 --- a/test/test.js +++ b/test/test.js @@ -132,7 +132,7 @@ describe( 'rollup', function () { return rollup.rollup({ entry: 'x', plUgins: [] }).then( () => { throw new Error( 'Missing expected error' ); }, err => { - assert.equal( err.message, 'Unexpected key \'plUgins\' found, expected one of: acorn, amd, banner, cache, context, dest, entry, exports, external, footer, format, globals, indent, interop, intro, legacy, moduleContext, moduleName, noConflict, onwarn, outro, paths, plugins, preferConst, sourceMap, sourceMapFile, targets, treeshake, useStrict' ); + assert.equal( err.message, 'Unexpected key \'plUgins\' found, expected one of: acorn, amd, banner, cache, context, dest, entry, exports, external, footer, format, globals, indent, interop, intro, legacy, moduleContext, moduleName, noConflict, onwarn, outro, paths, plugins, preferConst, sourceMap, sourceMapFile, targets, treeshake, useStrict, watch' ); }); });