Skip to content
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

Make line number selection work with TS and JSX syntax #3065

Open
novemberborn opened this issue Jul 10, 2022 · 0 comments
Open

Make line number selection work with TS and JSX syntax #3065

novemberborn opened this issue Jul 10, 2022 · 0 comments

Comments

@novemberborn
Copy link
Member

Line number selection relies on parsing the test file. This only supports JS syntax:

function parse(file) {
// Avoid loading these until we actually need to select tests by line number.
const acorn = require('acorn');
const walk = require('acorn-walk');
const ast = acorn.parse(fs.readFileSync(file, 'utf8'), {
ecmaVersion: 11,
locations: true,
sourceType: 'module',
});

Acorn has a plugin for JSX. If we want to use that we need to decide whether to add it to AVA's dependencies or how else we register it.

There is no plugin for TypeScript. We'd have to work out a solution so that line number selection can work without using @ava/typescript. See #3064 for making it work with @ava/typescript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant