Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improved recordAndTuple generator error message, added tests for inva…
…lid,missing options
- Loading branch information
1 parent
cdfd3bc
commit 1437239
Showing
6 changed files
with
38 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/babel-generator/test/fixtures/recordAndTupleSyntaxType/invalid-option/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#{ a: 1 } |
5 changes: 5 additions & 0 deletions
5
packages/babel-generator/test/fixtures/recordAndTupleSyntaxType/invalid-option/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"plugins": [["recordAndTuple", { "syntaxType": "hash" }]], | ||
"recordAndTupleSyntaxType": "invalid", | ||
"throws": "The \"recordAndTupleSyntaxType\" generator option must be either \"bar\" or \"hash\" (\"invalid\" received)" | ||
} |
1 change: 1 addition & 0 deletions
1
packages/babel-generator/test/fixtures/recordAndTupleSyntaxType/missing-option/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#{ a: 1 } |
4 changes: 4 additions & 0 deletions
4
packages/babel-generator/test/fixtures/recordAndTupleSyntaxType/missing-option/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"plugins": [["recordAndTuple", { "syntaxType": "hash" }]], | ||
"throws": "The \"recordAndTupleSyntaxType\" generator option must be either \"bar\" or \"hash\" (undefined received)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters