From 2874b46505e52fc0f56d80e2c47d9240d290f033 Mon Sep 17 00:00:00 2001 From: Vignesh Shanmugam Date: Fri, 11 Aug 2017 14:47:25 +0200 Subject: [PATCH] test for nested options in node api (#652) --- .../babili/__tests__/__snapshots__/node-api-tests.js.snap | 2 ++ packages/babili/__tests__/node-api-tests.js | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/packages/babili/__tests__/__snapshots__/node-api-tests.js.snap b/packages/babili/__tests__/__snapshots__/node-api-tests.js.snap index 02bcca18a..2f652c7ba 100644 --- a/packages/babili/__tests__/__snapshots__/node-api-tests.js.snap +++ b/packages/babili/__tests__/__snapshots__/node-api-tests.js.snap @@ -2,4 +2,6 @@ exports[`Babili Node API override default babili options 1`] = `"function foo(){const bar=x(1),baz=y(2);return z(bar,baz)}"`; +exports[`Babili Node API override nested babili options 1`] = `"function foo(){const a=x(1),b=y(2);return z(a,b)}"`; + exports[`Babili Node API simple usage 1`] = `"function foo(){const a=x(1),b=y(2);return z(a,b)}"`; diff --git a/packages/babili/__tests__/node-api-tests.js b/packages/babili/__tests__/node-api-tests.js index 857471fd5..9575e7963 100644 --- a/packages/babili/__tests__/node-api-tests.js +++ b/packages/babili/__tests__/node-api-tests.js @@ -23,4 +23,9 @@ describe("Babili Node API", () => { const babiliOpts = { mangle: false }; expect(babili(sampleInput, babiliOpts).code).toMatchSnapshot(); }); + + it("override nested babili options", () => { + const babiliOpts = { mangle: { keepFnName: false } }; + expect(babili(sampleInput, babiliOpts).code).toMatchSnapshot(); + }); });