Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
feat(ast-spec): add fixture test framework and some initial fixtures#3258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Diff view
Diff view
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -96,6 +96,12 @@ jobs: | ||
# Website will be built by the Netlify GitHub App | ||
yarn build --exclude website | ||
- name: Run unit tests for ast-spec | ||
run: yarn test | ||
working-directory: packages/ast-spec | ||
env: | ||
CI: true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Hmm, it would be nice to parallelize all these, store the coverage data as an artifact, and have a dependent job pick up the coverage after... not necessary for this PR, just noting down. 📝 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Yeah for sure, once I have finished my Nx refactoring we can opt into the Distributed Task Execution and let Nx Cloud decide how to parallelize and distribute across all available agents, then collect all artifacts | ||
- name: Run unit tests for typescript-estree | ||
run: npx nx test @typescript-eslint/typescript-estree | ||
env: | ||
@@ -308,6 +314,7 @@ jobs: | ||
env: | ||
CI: true | ||
# ast-spec is internal only - so don't care about compat on other versions | ||
# eslint-plugin-internal is internal only - so don't care about compat on other versions | ||
website_tests: | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -27,10 +27,7 @@ | ||
{ | ||
"icon": "jest_snapshot", | ||
"extensions": [ | ||
".shot", | ||
], | ||
"extends": "jest_snapshot" | ||
}, | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
class Foo implements 'thing' {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
exports[`AST Fixtures declaration ClassDeclaration _error_ implements-non-identifier TSESTree - Error 1`] = `"NO ERROR"`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
exports[`AST Fixtures declaration ClassDeclaration _error_ implements-non-identifier Babel - Error 1`] = `[SyntaxError: Unexpected token (1:21)]`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
exports[`AST Fixtures declaration ClassDeclaration _error_ implements-non-identifier Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
class Foo; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
exports[`AST Fixtures declaration ClassDeclaration _error_ no-body TSESTree - Error 1`] = `[TSError: '{' expected.]`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
exports[`AST Fixtures declaration ClassDeclaration _error_ no-body Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (1:9)]`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
exports[`AST Fixtures declaration ClassDeclaration _error_ no-body Error Alignment 1`] = `"Both errored"`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
class 'Foo' {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
exports[`AST Fixtures declaration ClassDeclaration _error_ non-identifier-name TSESTree - Error 1`] = `[TSError: '{' expected.]`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
exports[`AST Fixtures declaration ClassDeclaration _error_ non-identifier-name Babel - Error 1`] = `[SyntaxError: A class name is required. (1:6)]`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
exports[`AST Fixtures declaration ClassDeclaration _error_ non-identifier-name Error Alignment 1`] = `"Both errored"`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
abstract class Foo {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
exports[`AST Fixtures declaration ClassDeclaration abstract TSESTree - AST 1`] = ` | ||
Program { | ||
type: "Program", | ||
body: Array [ | ||
ClassDeclaration { | ||
type: "ClassDeclaration", | ||
abstract: true, | ||
body: ClassBody { | ||
type: "ClassBody", | ||
body: Array [], | ||
range: [19, 21], | ||
loc: { | ||
start: { column: 19, line: 1 }, | ||
end: { column: 21, line: 1 }, | ||
}, | ||
}, | ||
id: Identifier { | ||
type: "Identifier", | ||
name: "Foo", | ||
range: [15, 18], | ||
loc: { | ||
start: { column: 15, line: 1 }, | ||
end: { column: 18, line: 1 }, | ||
}, | ||
}, | ||
superClass: null, | ||
range: [0, 21], | ||
loc: { | ||
start: { column: 0, line: 1 }, | ||
end: { column: 21, line: 1 }, | ||
}, | ||
}, | ||
], | ||
sourceType: "script", | ||
range: [0, 22], | ||
loc: { | ||
start: { column: 0, line: 1 }, | ||
end: { column: 0, line: 2 }, | ||
}, | ||
} | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
exports[`AST Fixtures declaration ClassDeclaration abstract TSESTree - Tokens 1`] = ` | ||
Array [ | ||
Identifier { | ||
type: "Identifier", | ||
value: "abstract", | ||
range: [0, 8], | ||
loc: { | ||
start: { column: 0, line: 1 }, | ||
end: { column: 8, line: 1 }, | ||
}, | ||
}, | ||
Keyword { | ||
type: "Keyword", | ||
value: "class", | ||
range: [9, 14], | ||
loc: { | ||
start: { column: 9, line: 1 }, | ||
end: { column: 14, line: 1 }, | ||
}, | ||
}, | ||
Identifier { | ||
type: "Identifier", | ||
value: "Foo", | ||
range: [15, 18], | ||
loc: { | ||
start: { column: 15, line: 1 }, | ||
end: { column: 18, line: 1 }, | ||
}, | ||
}, | ||
Punctuator { | ||
type: "Punctuator", | ||
value: "{", | ||
range: [19, 20], | ||
loc: { | ||
start: { column: 19, line: 1 }, | ||
end: { column: 20, line: 1 }, | ||
}, | ||
}, | ||
Punctuator { | ||
type: "Punctuator", | ||
value: "}", | ||
range: [20, 21], | ||
loc: { | ||
start: { column: 20, line: 1 }, | ||
end: { column: 21, line: 1 }, | ||
}, | ||
}, | ||
] | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
exports[`AST Fixtures declaration ClassDeclaration abstract Babel - AST 1`] = ` | ||
Program { | ||
type: "Program", | ||
body: Array [ | ||
ClassDeclaration { | ||
type: "ClassDeclaration", | ||
abstract: true, | ||
body: ClassBody { | ||
type: "ClassBody", | ||
body: Array [], | ||
range: [19, 21], | ||
loc: { | ||
start: { column: 19, line: 1 }, | ||
end: { column: 21, line: 1 }, | ||
}, | ||
}, | ||
id: Identifier { | ||
type: "Identifier", | ||
name: "Foo", | ||
range: [15, 18], | ||
loc: { | ||
start: { column: 15, line: 1 }, | ||
end: { column: 18, line: 1 }, | ||
}, | ||
}, | ||
superClass: null, | ||
range: [0, 21], | ||
loc: { | ||
start: { column: 0, line: 1 }, | ||
end: { column: 21, line: 1 }, | ||
}, | ||
}, | ||
], | ||
sourceType: "script", | ||
range: [0, 22], | ||
loc: { | ||
start: { column: 0, line: 1 }, | ||
end: { column: 0, line: 2 }, | ||
}, | ||
} | ||
`; |
Uh oh!
There was an error while loading.Please reload this page.