From f9b95f4d87466b5a99856b06ffd830232e937f7b Mon Sep 17 00:00:00 2001 From: marsonya Date: Mon, 2 Nov 2020 19:56:28 +0530 Subject: [PATCH] Doctest Contribution Guidelines | Implementation details and reference --- CONTRIBUTING.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1c6ae99a3..87bbc792f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -86,6 +86,18 @@ To maximize the readability and correctness of our code, we require that new sub 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. +The implementation of doctest is quite simple. You can easily learn it [here](https://www.npmjs.com/package/doctest). + +It is advised that you add the Doctests in a multiline comment just after the Algorithm description. +/** +* Algorithm Description Here +* The Wikipedia Link +*/ +/** +* Doctests Here +*/ +For Code Structure reference see [this file](https://github.com/TheAlgorithms/Javascript/blob/master/Sorts/BubbleSort.js). + - Most importantly, - **Be consistent in the use of these guidelines when submitting.**