Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
thorn0 committed Apr 3, 2021
1 parent 3e7a202 commit ca7fd66
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 0 deletions.
64 changes: 64 additions & 0 deletions tests/js/assignment/__snapshots__/jsfmt.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,70 @@ const {
================================================================================
`;

exports[`destructuring-heuristic.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
{{
const {
id,
static: isStatic,
method: isMethod,
methodId,
getId,
setId,
} = privateNamesMap.get(name);
const {
id1,
method: isMethod1,
methodId1
} = privateNamesMap.get(name);
const {
id2,
method: isMethod2,
methodId2
} = privateNamesMap.get(bifornCringerMoshedPerplexSawder);
const {
id3,
method: isMethod3,
methodId3
} = anodyneCondosMalateOverateRetinol.get(bifornCringerMoshedPerplexSawder);
}}
=====================================output=====================================
{
{
const {
id,
static: isStatic,
method: isMethod,
methodId,
getId,
setId,
} = privateNamesMap.get(name);
const { id1, method: isMethod1, methodId1 } = privateNamesMap.get(name);
const { id2, method: isMethod2, methodId2 } = privateNamesMap.get(
bifornCringerMoshedPerplexSawder
);
const {
id3,
method: isMethod3,
methodId3,
} = anodyneCondosMalateOverateRetinol.get(bifornCringerMoshedPerplexSawder);
}
}
================================================================================
`;

exports[`issue-1419.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
Expand Down
28 changes: 28 additions & 0 deletions tests/js/assignment/destructuring-heuristic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{
const {
id,
static: isStatic,
method: isMethod,
methodId,
getId,
setId,
} = privateNamesMap.get(name);

const {
id1,
method: isMethod1,
methodId1
} = privateNamesMap.get(name);

const {
id2,
method: isMethod2,
methodId2
} = privateNamesMap.get(bifornCringerMoshedPerplexSawder);

const {
id3,
method: isMethod3,
methodId3
} = anodyneCondosMalateOverateRetinol.get(bifornCringerMoshedPerplexSawder);
}}

0 comments on commit ca7fd66

Please sign in to comment.