mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 16:26:47 +08:00
@ -52,7 +52,7 @@ Algorithms in this repo should not be how-to examples for existing JavaScript pa
|
||||
#### Testing
|
||||
|
||||
Be confident that your code works. When was the last time you committed a code change, your build failed, and half of your app stopped working? Mine was last week. Writing tests for our Algorithms will help us ensure the implementations are air tight even after multiple fixes and code changes.
|
||||
We use a NPM package [doctest](https://www.npmjs.com/package/doctest) to add basic testing functionality to our code. Doctests are simple structured comments that evaluate an function and ensure a required result.
|
||||
We use a NPM package [doctest](https://www.npmjs.com/package/doctest) to add basic testing functionality to our code. Doctests are simple structured comments that evaluate a function and ensure a required result.
|
||||
|
||||
The implementation of doctest is quite simple. You can easily learn it [here](https://www.npmjs.com/package/doctest).
|
||||
|
||||
@ -76,7 +76,7 @@ To maximize the readability and correctness of our code, we require that new sub
|
||||
$ standard MyFile.js // if that fails, try: npx standard MyFile.js
|
||||
```
|
||||
|
||||
- Use camelCase for with leading character lowercase for identifier names (variables and functions)
|
||||
- Use camelCase with the leading character as lowercase for identifier names (variables and functions)
|
||||
- Names start with a letter
|
||||
- follow code indentation
|
||||
- Always use 2 spaces for indentation of code blocks
|
||||
|
Reference in New Issue
Block a user