This is my leetcode solutions in javaScript, included some implementations for the useful data structures and algorithms.
See: https://williammer.github.io/leetcode-js
Note: all the npm run xx
commands below can be replaced with the shorter yarn xx
command, or
nr xx
command if installed "npm-quick-run".
$ npm i
Add:
$ npm run do add <question number> <question title>
Copy:
$ npm do cp <question number> <question title> <question number to be copied>
Remove:
$ npm run do rm <question number>
To test all suites:
$ npm test
To test one or some suites:
$ npm test <regexForTestFiles>
Watch mode:
$ npm run test:watch
or:
$ npm test -- --watch
with codecov report:
$ npm run test:codecov
You can also use jest cli
to run test with extra options.
After the test finished running, a __testReport.html
file will be generated.
You can open it in browser to see a clearer version of test report.