Let's make solving LeetCode problems easier.
In the future my aim is to have the initial test cases provided with every free problems.
Practice TS skills and write in a TDD manner.
npm install
oryarn
- Test files should be have
.test.ts
extensions. - Solution files should use the format
export { FunctionName }
to avoid invalid syntax for generated files. npm test
ornpm run watch:test
during development to check if your test cases are passing.- Before submissions, generate valid JS solutions run
npm run build
.- Generated files would be on
dist
folder. This are the files to be submitted to LeetCode
- Generated files would be on
-
(Optional) Use extension LeetCode by ShengChen
- You'll be able to test or submit directly. Use the build files inside
dist
- You'll be able to test or submit directly. Use the build files inside
-
Included are debug run configurations for TS file
Current TS File
or Mocha Test fileCurrent TS Mocha File
- You'll probably use
Current TS Mocha File
run more if you write the test scripts first. - LeetCode already have the test scripts on the problem description anyway
- You'll probably use
Improvements and additional test cases are welcome.
It will not. The build
would compile the file to es6. There will be also additional code that will be generated due to the way TS transpiles the code to JS.