LearningTypeScript / projects

Hands-on real world projects that will help you exercise your knowledge of TypeScript.
https://learningtypescript.com/projects
240 stars 160 forks source link

🛠 Tooling: Solution checks are running on parent directories without package.jsons #257

Closed JoshuaKGoldberg closed 1 year ago

JoshuaKGoldberg commented 1 year ago

Tooling Report Checklist

Expected

When any file in a project is changed -regardless of whether it's the project's README.md or a nested file like src/index.ts- then the project should have its tests run in CI.

Actual

It looks like npm run test:solutions is getting run on both the project directory (e.g. projects/arrays/text-processor) and its parent directory (e.g. projects/arrays).

https://github.com/LearningTypeScript/projects/actions/runs/4456474445/jobs/7826946260?pr=256

Run ./scripts/changed-solutions.sh projects/arrays/text-processor/README.md projects/arrays/text-processor/src/index.test.ts "test:solutions"

Running test:solutions for projects/arrays/text-processor
npm ERR! Missing script: "test:solutions"
npm ERR! 
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2023-03-18T17_20_[4](https://github.com/LearningTypeScript/projects/actions/runs/4456474445/jobs/7826946260?pr=256#step:7:5)6_[5](https://github.com/LearningTypeScript/projects/actions/runs/4456474445/jobs/7826946260?pr=256#step:7:6)5[8](https://github.com/LearningTypeScript/projects/actions/runs/4456474445/jobs/7826946260?pr=256#step:7:9)Z-debug-0.log

Running test:solutions for projects/arrays/text-processor/src

> test:solutions
> cross-env TEST_SOLUTIONS=1 jest

PASS src/index.test.ts
  alignTexts
    ✓ [""] { width: 0 } (1 ms)

Additional Info

This has been bugging me for a while but I haven't had the time to really investigate. Glad I finally got around to it!