Skip to content

Commit

Permalink
test for nested options in node api (#652)
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshshanmugam authored and boopathi committed Aug 11, 2017
1 parent c278d8e commit 2874b46
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)}"`;
5 changes: 5 additions & 0 deletions packages/babili/__tests__/node-api-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});

0 comments on commit 2874b46

Please sign in to comment.