onepub-dev / onepub-dev/dcli

DartProject.current doesn't work within a unit test.

Open
#136 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dart
Stars
265
Forks
30
PR merge metrics
No merged PRs in 30d

Description

The problem is that DartProject.current first calls Script.current.

When we are running in a unit test Script.current returns 'test.dart' which results in a bogus
DartProject.

Need to review how we detect the project as we have several different operation modes:

From local source
Compiled script
Running under a unit test.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing DartProject.current and its call to Script.current. Reproduce the behavior in a unit test, then compare project detection for local source, compiled scripts, and unit-test execution. Done means DartProject.current identifies the correct project in all three operation modes.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.