Skip to content
This repository was archived by the owner on Jan 14, 2019. It is now read-only.

Commit f88ba08

Browse files
committed
chore: enable valid alignment tests and update tickets links
1 parent 4ecdb8b commit f88ba08

File tree

1 file changed

+12
-19
lines changed

1 file changed

+12
-19
lines changed

tests/ast-alignment/fixtures-to-test.ts

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const jsxFilesWithKnownIssues = jsxKnownIssues.map(f => f.replace('jsx/', ''));
3333
* TSEP - SyntaxError
3434
* Babylon - RangeError
3535
*
36-
* Reported here: https://github.com/babel/babylon/issues/674
36+
* Reported here: https://github.com/babel/babel/issues/6680
3737
*/
3838
jsxFilesWithKnownIssues.push('invalid-no-tag-name');
3939

@@ -66,7 +66,7 @@ function createFixturePatternConfigFor(
6666
config.parseWithSourceTypeModule = config.parseWithSourceTypeModule || [];
6767
/**
6868
* The TypeScript compiler gives us the "externalModuleIndicator" to allow typescript-estree do dynamically detect the "sourceType".
69-
* Babylon does not have an equivalent feature (although perhaps it might come in the future https://github.com/babel/babylon/issues/440),
69+
* Babylon does not have an equivalent feature (although perhaps it might come in the future https://github.com/babel/babel/issues/6695),
7070
* so we have to specify the "sourceType" we want to use.
7171
*
7272
* By default we have configured babylon to use "script", but for any fixtures specified in the parseWithSourceTypeModule array we need "module".
@@ -106,14 +106,14 @@ let fixturePatternConfigsToTest = [
106106

107107
createFixturePatternConfigFor('comments', {
108108
ignore: [
109-
'export-default-anonymous-class', // needs to be parsed with `sourceType: "module"`
110109
/**
111110
* Template strings seem to also be affected by the difference in opinion between different parsers in:
112-
* https://github.com/babel/babylon/issues/673
111+
* https://github.com/babel/babel/issues/6681
113112
*/
114113
'no-comment-template', // Purely AST diffs
115114
'template-string-block' // Purely AST diffs
116-
]
115+
],
116+
parseWithSourceTypeModule: ['export-default-anonymous-class']
117117
}),
118118

119119
createFixturePatternConfigFor('javascript/templateStrings', {
@@ -211,10 +211,6 @@ let fixturePatternConfigsToTest = [
211211

212212
createFixturePatternConfigFor('javascript/modules', {
213213
ignore: [
214-
/**
215-
* TypeScript, flow and babylon parse this fine - esprima, espree and acorn do not...
216-
*/
217-
'invalid-export-default', // typescript-estree parse errors
218214
/**
219215
* Expected babylon parse errors - all of these files below produce parse errors in espree
220216
* as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree
@@ -339,15 +335,12 @@ let fixturePatternConfigsToTest = [
339335
createFixturePatternConfigFor('tsx', {
340336
fileType: 'tsx',
341337
ignore: [
342-
/**
343-
* AST difference
344-
*/
345-
'react-typed-props',
346338
/**
347339
* currently babylon not supported
348340
*/
349341
'generic-jsx-element'
350-
]
342+
],
343+
parseWithSourceTypeModule: ['react-typed-props']
351344
}),
352345

353346
/* ================================================== */
@@ -425,7 +418,7 @@ let fixturePatternConfigsToTest = [
425418
'abstract-class-with-optional-method', // babylon parse errors
426419
'declare-class-with-optional-method', // babylon parse errors
427420
/**
428-
* Awaiting feedback on Babylon issue https://github.com/babel/babylon/issues/700
421+
* Awaiting feedback on Babylon issue https://github.com/babel/babel/issues/6679
429422
*/
430423
'class-with-private-parameter-properties',
431424
'class-with-protected-parameter-properties',
@@ -499,14 +492,14 @@ let fixturePatternConfigsToTest = [
499492
ignore: [
500493
/**
501494
* AST difference
502-
* tsep: TSAbstractClassDeclaration
503-
* babel: ClassDeclaration[abstract=true]
495+
* tsep: heritage = []
496+
* babel: heritage = undefined
504497
*/
505498
'interface',
506499
/**
507500
* AST difference
508-
* tsep: heritage = []
509-
* babel: heritage = undefined
501+
* tsep: TSAbstractClassDeclaration
502+
* babel: ClassDeclaration[abstract=true]
510503
*/
511504
'abstract-class'
512505
]

0 commit comments

Comments
 (0)