Skip to content

Commit

Permalink
Add tests for babel/babel#12267
Browse files Browse the repository at this point in the history
  • Loading branch information
sosukesuzuki committed Nov 6, 2020
1 parent f934269 commit c4d10b5
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 1 deletion.
14 changes: 14 additions & 0 deletions tests/js/binary-expressions/__snapshots__/jsfmt.spec.js.snap
Expand Up @@ -740,6 +740,20 @@ printWidth: 80
================================================================================
`;

exports[`like-regexp.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
0 ? a : { b : 1 }/2;
=====================================output=====================================
0 ? a : { b: 1 } / 2;
================================================================================
`;

exports[`math.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
Expand Down
4 changes: 3 additions & 1 deletion tests/js/binary-expressions/jsfmt.spec.js
@@ -1 +1,3 @@
run_spec(__dirname, ["babel", "flow", "typescript"]);
run_spec(__dirname, ["babel", "flow", "typescript"], {
errors: { espree: ["like-regexp.js"] },
});
1 change: 1 addition & 0 deletions tests/js/binary-expressions/like-regexp.js
@@ -0,0 +1 @@
0 ? a : { b : 1 }/2;
17 changes: 17 additions & 0 deletions tests/js/label/__snapshots__/jsfmt.spec.js.snap
@@ -1,5 +1,22 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`block-statement-and-regexp.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
a : { b : 1 }/2/;
=====================================output=====================================
a: {
b: 1;
}
/2/;
================================================================================
`;

exports[`comment.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
Expand Down
1 change: 1 addition & 0 deletions tests/js/label/block-statement-and-regexp.js
@@ -0,0 +1 @@
a : { b : 1 }/2/;

0 comments on commit c4d10b5

Please sign in to comment.