Comments (8)
PS: totally the same behaviour when s/string/number/
from typescript.
OK, in the meantime I was able to find out, that tsc
will complain about a syntax error:
hello-world.ts(2,33): error TS1005: ',' expected.
After some googling I found that correct syntax for the class were:
class HelloWorld {
static hello(name: number = "World"): number {
return "Hello, " + name + "!"
}
}
compiling this, now successfully complains about types beeing incorrect:
hello-world.ts(2,18): error TS2322: Type '"World"' is not assignable to type 'number'.
hello-world.ts(3,9): error TS2322: Type 'string' is not assignable to type 'number'.
hello-world.test.ts(11,29): error TS2345: Argument of type '"Bob"' is not assignable to parameter of type 'number'.
hello-world.test.ts(15,29): error TS2345: Argument of type '"Sally"' is not assignable to parameter of type 'number'.
Therefore I have to assume, that the typescript-track currently doesn't even use typescript!
from typescript.
Good point. I filed a bug/feature question.
As a work around we could run the compiler every time we run the tests to catch this
"test": "tsc -p . && jest --no-cache",
I do think since ts-jest compiles the code before running jest that they should display any errors from the compiler and fail.
from typescript.
You filed a bug/feature where? Do you have a link/crossref?
from typescript.
from typescript.
Also, a better way to alter the script line seems to be: tsc --noEmit -p . && jest --no-cache
.
This way there is no javascript generated which leads to running the tests twice by jest
from typescript.
What rabbit hole. Others are also using --noEmit. I think that is what we are going to use too: ds300/react-native-typescript-transformer#13
from typescript.
@masters3d thanks for doing that PR! Looks like a good solution.
And thanks for catching this @NobbZ. Just implemented the tsc --noEmit in my own copy of the exercises and found out my Hello World solution didn't pass anymore hah.
from typescript.
Related Issues (20)
- At least one deadlink in the REPO HOT 1
- Test-Cases of `rational-numbers` exercise satisfied by dummy-implementation
- DnD Character - confused about the purpose and execution of the exercise HOT 4
- [Grade School] Tests fail on a valid approach
- Lack to add documentation references in the exercise instructions. HOT 5
- Instructions for the exercise Secret handshake (typescript exercise #16) are confusing HOT 3
- Spelling issue in Largest Series Product
- [Grade School] Can't use Readonly<> types for later tests HOT 7
- Update Pig Latin tests HOT 1
- `word-count` exercise test not aligned with instructions HOT 1
- ESLint cannot find already installed plugins when linting exercises in local environment HOT 12
- yarn install / yarn test does not work out of the box for typescript exercises HOT 2
- Building a training set of tags for typescript HOT 21
- hello world not work HOT 1
- Deprecated String.prototype.substr() in robot-name.test.ts HOT 1
- Why does two-bucket use both xtest and test.skip ? HOT 1
- Two-Fer exercise skips 2/3 tests with `xit` HOT 2
- 'Robot Name' false positive tests HOT 6
- Exercise Word Count in Typescript. Tests are wrong
- Missing test case for problem "luhn"
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 typescript.