From a739c51d32110eb653e9d18724c6a9381259d932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Segersv=C3=A4rd?= Date: Wed, 30 Dec 2015 21:12:39 +0100 Subject: [PATCH] Add failing test --- test/function/export-destruction/_config.js | 12 ++++++++++++ test/function/export-destruction/main.js | 5 +++++ 2 files changed, 17 insertions(+) create mode 100644 test/function/export-destruction/_config.js create mode 100644 test/function/export-destruction/main.js diff --git a/test/function/export-destruction/_config.js b/test/function/export-destruction/_config.js new file mode 100644 index 0000000..263c8d1 --- /dev/null +++ b/test/function/export-destruction/_config.js @@ -0,0 +1,12 @@ +var assert = require( 'assert' ); + +module.exports = { + description: 'handle destruction patterns in export declarations', + babel: true, + + exports: function ( exports ) { + assert.deepEqual( Object.keys( exports ), [ 'baz', 'quux' ] ); + assert.equal( exports.baz, 5 ); + assert.equal( exports.quux, 17 ); + } +}; diff --git a/test/function/export-destruction/main.js b/test/function/export-destruction/main.js new file mode 100644 index 0000000..d178da4 --- /dev/null +++ b/test/function/export-destruction/main.js @@ -0,0 +1,5 @@ +var foo = { bar: { baz: 5 } }; +var arr = [ { quux: 'wrong' }, { quux: 17 } ]; + +export var { bar: { baz } } = foo; +export var [ /* skip */, { quux } ] = arr;