Skip to content

Williammer/leetcode-js

Repository files navigation

Intro

Build Status codecov

This is my leetcode solutions in javaScript, included some implementations for the useful data structures and algorithms.

Solutions

See: https://williammer.github.io/leetcode-js

Usages

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".

1. Install Packages

$ npm i

2. Actions for solution/test

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>

3. Testing

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.