avajs / avajs/ava

Make line number selection work with TS and JSX syntax

Open
#3,065 3 comments 1 reaction 0 assignees View on GitHub
enhancement help wanted scope:globbing scope:internals scope:typescript
Dominant language
JavaScript
Stars
20.8k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

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

https://github.com/avajs/ava/blob/ac0d75d05d28e511b1b3654b09d11d602e360179/lib/worker/line-numbers.js#L9-L18

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 https://github.com/avajs/ava/issues/3064 for making it work _with_ `@ava/typescript`.

Contributor guide

Open the contributing guide

Research direction

Start with lib/worker/line-numbers.js, especially the parsing logic linked in the issue, and review Acorn's JSX plugin options. Determine how line number selection can support JSX and TypeScript without relying on @ava/typescript, including how any required parser plugin or dependency would be registered; the related issue #3064 provides context for TypeScript integration.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
testing, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.