-
Notifications
You must be signed in to change notification settings - Fork 97
Use ts-mocha to run tests #444
Use ts-mocha to run tests #444
Conversation
@kenashcraft thanks for the contribution. Please rebase the PR, this should fix the build. We have already removed the dependencies on |
Codecov Report
@@ Coverage Diff @@
## master #444 +/- ##
==========================================
- Coverage 95% 94.83% -0.17%
==========================================
Files 147 146 -1
Lines 9566 9739 +173
Branches 680 692 +12
==========================================
+ Hits 9088 9236 +148
- Misses 478 503 +25
Continue to review full report at Codecov.
|
"codecov": "nyc report --reporter=json && codecov -f coverage/*.json", | ||
"clean": "rimraf build/*", | ||
"check": "gts check", | ||
"compile": "tsc -p .", | ||
"compile:release": "tsc -p tsconfig-release.json", | ||
"fix": "gts fix", | ||
"prepare": "npm run compile:release", | ||
"pretest": "npm run compile", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should still keep this and add into unit test workflow. Something like below in .circleci/config.yml
WDYT?
- run:
name: Compile code
command: npm run compile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like that config is for the entire repo. That would cause all of the other packages to run the compile step twice. Is that ok and/or should I change all of the other packages to use ts-mocha?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to change all packages to use ts-mocha
. Also, does it make sense to remove dependencies on mocha
and @types/mocha
after this? @draffensperger any thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we can't remove the dependencies. The ts-mocha page says we need them: https://www.npmjs.com/package/ts-mocha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok SG.
…ed to .js to get the tests to pass.
…ge package.json as part of this PR.
@mayurkale22 Looks like I finally got all of the tests passing. I did my best to ensure I was changing only the files that needed to be changed, but please double check before we merge. |
Can you please create an issue to track remaining packages. |
Added issue #447. |
@@ -38,6 +37,16 @@ | |||
"LICENSE", | |||
"README.md" | |||
], | |||
"nyc": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: Can we move these configuration options in .nycrc
, later on we can add coverage threshold and other options. Also this will make package.json
more cleaner. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The official docs didn't offer that as an option: https://istanbul.js.org/docs/tutorials/typescript/ . I don't know if it is supported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I referred this link https://github.com/istanbuljs/nyc#configuring-nyc
This gives good stack traces during tests and means we can skip the compile step. Converts all packages except: