Skip to content

Repo: Add an end-to-end (Playwright) test for the playground's AST viewer #6086

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JoshuaKGoldberg opened this issue Nov 25, 2022 · 2 comments · Fixed by #6275
Closed

Repo: Add an end-to-end (Playwright) test for the playground's AST viewer #6086

JoshuaKGoldberg opened this issue Nov 25, 2022 · 2 comments · Fixed by #6275
Labels
accepting prs Go ahead, send a pull request that resolves this issue good first issue Good for newcomers repo maintenance things to do with maintenance of the repo, and not with code/docs

Comments

@JoshuaKGoldberg
Copy link
Member

Suggestion

Following #6080, I realized there was one more test for the https://typescript-eslint.io/play playground that I wanted to add!

  1. Type some code into the editor
  2. Enable the AST viewer
  3. Check that the AST shows nodes corresponding to the code

Leaving this open as a good first issue so anybody who wants to contribute can.

Screenshot of typescript-eslint.io showing the ESTree AST for console.log('hello, world!')

@JoshuaKGoldberg JoshuaKGoldberg added triage Waiting for team members to take a look repo maintenance things to do with maintenance of the repo, and not with code/docs good first issue Good for newcomers accepting prs Go ahead, send a pull request that resolves this issue and removed triage Waiting for team members to take a look labels Nov 25, 2022
@armano2
Copy link
Collaborator

armano2 commented Apr 4, 2023

some tests that we should add (this is my normal checklist after i do some changes)

Type Checking:

/play/#ts=4.7.1-rc&sourceType=module&code=PTAEFpK6ZhYAUCUBnALgJwJYGM3gCMB7IgGwFMBDAO3HIA8AHDclFLI6lRZWPvxIiwAzUAApMAV3KgAZLNABGUAGolASlABvUAF9EAdwAWWCuOGVSKGQB8boAESUHqxwQeat+hGPoAuUCICACtyPE0AXgA+UClbewsreNB6UAB+WIxpUADE6wBuQSQwflKoHjBqIkJKa3A0avRsagBzCogy0qKHFzUvfNBQZEAZclAqmrqG8CasVqLeTv528eFSIko0WZbwZiIAWyxrbmKOxdgi2oBPahxQYUkbzc47kjFPUBY0SQxqJQHvBiMIgYNB3B54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D2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA

Parsing comments:

/play/#ts=5.0.2&sourceType=module&code=PQKgBApgzgNglgOwC5gEQAEkE8AO0DGATnDkgLTTzLAID2ZArgg1BACZkBuAhoVKgC40EQoVqFUYEMACwAKHn5aCKCgAeYALxgATEA&eslintrc=N4KABGBEBOCuA2BTAzpAXGYBfEWg&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA

User defined compiler options

/play/#ts=4.7.1-rc&jsx=true&sourceType=module&showAST=es&code=GYVwdgxgLglg9mABAMTnRAKAlALkQKQGUANAOgFEAbAUwFtqwpEBvAWAChEvEAnaqEDyQAeACYwAbgD5hAenHSOAXw5A&rules=N4XyA&tsConfig=N4XyA

Should show error on missing libs

/play/#ts=4.6.2&sourceType=module&code=CYUwxgNghgTiAEAzArgOzAFwJYHtXwDcctgB5GABRhwFssBnEAClgHMAueJpgSngF4AfIWLA+AHy68BwqrQYgAPERKCePTiuABuIA&eslintrc=N4KABGBEBOCuA2BTAzpAXGYBfEWg&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkqyARhWANoC64YAviF0A

Should deduce libs base on target

/play/#ts=5.0.2&jsx=true&sourceType=module&code=MYewdgzgLgBAHjAvDMBTA7jACgJxAWwEsJUAKASgG4BYAKCA&eslintrc=N4KABGBEAOCGBOBnApvSAuKABALgT2mUQGN4BLaHAWiIBsyA7HAejiVUgBpwo2V4A8pTIB7BogxhQECDHgiAVsmI5JkAHTMcJMQDMyAc3ULEYyDwC+3WdFoBXA4wmYA2j1m4CRUhWp1GqjwAutZQ8Ha0RJLSMpCehCTklDSI9EzMDCJUmQzZEbRUsIj8OMgAJlQiwmKwBcQAFrCMaqjyaJYgFkA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkeAhpgObp4VTokDMk4YAviH5A

Should parse simple eslint config when pasted

module.exports = {
  parser: '@typescript-eslint/parser',
  parserOptions: {
    project: './tsconfig.json'
  },
  plugins: ['@typescript-eslint'],
  rules: {
    "@typescript-eslint/no-non-null-asserted-optional-chain": "error"
  }
}

Additional checks

  • verify if ast is updating
  • verify if page is not crashign when goign from - to playground with navigation
  • verify if linting is beeing triggered
  • verify if resizing works
  • verify if changing theme is applied to editor

@JoshuaKGoldberg
Copy link
Member Author

@armano2 I'm filing a new issue 😄 just taking a while to type out... wanted to give #6275 & @tapanprakasht the glory of resolving one!

@armano2 armano2 closed this as completed Apr 5, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue good first issue Good for newcomers repo maintenance things to do with maintenance of the repo, and not with code/docs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants