Comments (6)
Ah sorry if the OP is unclear, thanks for asking!
Right now a lot of projects have package.json scripts that look like this (example: analyzing-dna
):
"scripts": {
"test": "jest",
"test:solutions": "cross-env TEST_SOLUTIONS=1 jest"
}
Nothing in CI validates that the solution file (typically solutions.ts
) in those projects passes TypeScript type checking. Someone could send in a PR with solution code that passes Jest tests but has a type error.
So, there should be some new step added to builds that runs tsc
on all solution code. Does that make sense?
from projects.
Hey @JoshuaKGoldberg , I don't seem to understand this issue and I would love to help with it, if possible.
from projects.
This makes sense @JoshuaKGoldberg .
Should this be another CI? Or should it be augmented with the solutions CI?
from projects.
What do you see as the pros and cons of those two options? 🙂
from projects.
The cons of augmenting them IMO is if the solutions CI fail, and one runs the test on their local machine and it passes they might be confused. I would add descriptive logs like type errors at /path/to/file.
The pro of augmenting IMO is the speed of CI.
from projects.
if the solutions CI fail, and one runs the test on their local machine and it passes they might be confused
Sorry, I don't follow why this would be likely to happen? Assuming the user has run npm install
, why would they be different locally vs. on CI?
I see the cons of augmenting as being mostly related to the cons of running the two checks in series:
- Clarity: If the first fails, the second won't even start
- Speed: The second can't start until the first is done.
They could be run in parallel, but the CI images are pretty limited and don't have a lot of cores. Also I'd imagine the output logs would be confusing to read.
In general for CI, I've found it to be better to have a single job/workflow per discrete action/check. In this case that would lean towards adding a new one for tsc
.
from projects.
Related Issues (20)
- ✍ Typo: [classifying-creatures] various typos HOT 1
- ✍ Typo: [modifiers-of-the-types] Misnamed function in README.md HOT 1
- 🐛 Bug: [Text Processor] Inconsistent tests expected results HOT 1
- ✍ Typo: [treasure-hunter] Inconsistent property names HOT 1
- Project: add a non-classes step to The Typeinator
- Projects: explain prerequisites explicitly HOT 1
- ✍ Typo: [system-of-a-clown] typo in solution HOT 2
- ✍ Typo: [the-shape-of-types] Check for Greater than or Equal to instead of Greater thank. HOT 1
- 🛠 Tooling: Solution checks are running on parent directories without package.jsons
- 🛠 Tooling: 01-syntactic-sugar tests fail on Node 19 HOT 1
- 🐛 Bug: [the-shape-of-types] MockHorror class fails type checking in solution tests
- 🐛 Bug: [secret-messages/02-allowed-imports] Solution errors in CI: Could not find a declaration file
- ✍ Typo: [Treasure-Hunter] added more details to the README.md HOT 1
- 🐛 Bug: [Text Processor] test will always PASS
- 🐛 Bug: projects/arrays/text-processor/src/solution-alternate.ts has some bugs HOT 2
- ✍ Typo: [Secret Secrets] Typo and missing text in project steps
- 🐛 Bug: [08-classes-horror-factory] tsc errors HOT 4
- 🐛 Bug: [02-clown-availability] <Missing type> HOT 1
- ✍ Typo: Some projects reference a .test.ts file that doesn't exist
- Chore: Bump TypeScript to 5.4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from projects.