37 Commits

Author SHA1 Message Date
86d333ee94 feat: Test running overhaul, switch to Prettier & reformat everything (#1407)
* chore: Switch to Node 20 + Vitest

* chore: migrate to vitest mock functions

* chore: code style (switch to prettier)

* test: re-enable long-running test

Seems the switch to Node 20 and Vitest has vastly improved the code's and / or the test's runtime!

see #1193

* chore: code style

* chore: fix failing tests

* Updated Documentation in README.md

* Update contribution guidelines to state usage of Prettier

* fix: set prettier printWidth back to 80

* chore: apply updated code style automatically

* fix: set prettier line endings to lf again

* chore: apply updated code style automatically

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2023-10-04 02:38:19 +05:30
1381ed0c17 feat: add dutchNationalFlagSort implementation (#1305)
* feat: add dutchNationalFlagSort implementation

* fix: add test, fit code style

* fix: add link to directory.md
2023-03-04 10:39:21 +05:30
18baef8e7e feat: insertion sort with binary search (#1182) 2022-10-16 10:47:18 +02:00
32b9a9900e Swapsort algorithm and corresponding tests (#1152) 2022-10-13 17:26:31 +05:30
d3cec8b28f merge: Rename secondLargestElement.test.js to SecondLargestElement.test.js (#1039) 2022-06-06 14:02:12 +05:30
c105c4d0a2 merge: Rename pigeonHoleSort.test.js to PigeonHoleSort.test.js (#1038) 2022-06-05 22:29:06 +05:30
61ee22459b merge: Add test case to Find Second Largest Element Algorithm (#1037) 2022-06-05 08:51:58 +05:30
0dccd280f3 merge: fix typo(change file name) (#1034) 2022-06-02 12:03:04 +05:30
d28ae8b1f7 merge: Update test case for bubbleSort ( with code style is fixed) (#1020)
* Update test case for bubbleSort

* re-update test case for bubble sort

* re-update test case for bubbleSort
2022-05-23 22:27:11 +05:30
01db0fb369 Fix wiggle sort (#991)
Co-authored-by: Antonia Strack <antonia.strack@thm.mni.de>
2022-04-28 12:16:13 +02:00
2e18fbb39a merge: Add the Stooge Sort Algorithm (#998)
* Add stooge sort sorting algorithm with included tests

* Add stooge sort sorting algorithm with included tests

* Add correct url for more information

* Add time complexity warning
2022-04-28 13:47:23 +05:30
35035f7afa merge: Add test case and fix TimSort algo (#977) 2022-04-03 16:28:36 +05:30
2169e17d47 merge: Add test case to shellSort algorithm (#975) 2022-04-03 16:27:56 +05:30
6f33f990f2 merge: Add test case and fix pigeonHoleSort Algorithm (#967) 2022-04-01 12:28:43 +05:30
871a49f3cd merge: test case to radixSort Algorithm (#968) 2022-04-01 12:28:12 +05:30
d47555b026 merge: Add test case and fix HeapSort Algorithm (#969) 2022-03-31 19:27:44 +05:30
d6a327a988 merge: Add test case and fix the OddEvenSort Algorithm (#955) 2022-03-27 22:45:46 +05:30
55da7a1d7c merge: Add test case to HeapSort Algorithm (#947) 2022-03-24 21:50:57 +05:30
73efc89d29 merge: Fix GnomeSort algorithm and Add test case to it (#948) 2022-03-24 21:50:39 +05:30
532cf3e613 merge: Add test case to FlashSort algorithm (#946) 2022-03-24 21:50:21 +05:30
699146fb4e merge: Add test case to secondLargestElement Algorithm (#945) 2022-03-23 22:13:09 +05:30
ecf7cf9fe3 merge: Add test case to countingSort algorithm (#943) 2022-03-22 20:26:55 +05:30
00f593662b merge: Add alternative implementation for InsertionSort and relative test. Add additional algorithm description (#915)
Co-authored-by: Andrea Tota <tota@qi4m.com>
2022-03-04 19:41:37 +05:30
dbc98d096b merge: Bubble Sort enhancements for nearly sorted or sorted array, added test cases and documentation (#895)
* BubbleSort enacements for nearly sorted or sorted array and added test cases

* BubbleSort enacements for nearly sorted or sorted array and added test cases

* Bubble sort requested changes solved

* standard js style issue fixed
2022-02-19 17:53:54 +05:30
0aa5094bfd merge: add alphanumerical sort (#872)
* alphanumerical sort

* [/pull/872] add description to alphanumerical sort

* [/pull/872] add description to localCompare fn

* [/pull/872] code formatter
2021-12-20 22:23:28 +05:30
9ed5d8cde6 Add Pancake Sort to the sorting algorithms 2021-10-21 09:48:53 -03:00
b13b12e88c chore: merge Fix/742 migrate doctest to jest (#749)
* Remove QuickSelect doctest

There are more Jest test cases already.

* Remove AverageMedian doctest

Already migrated to jest

* Migrate doctest for BinaryExponentiationRecursive.js

(also remove inline "main" test method)

* Migrate doctest for EulersTotient.js

(also remove inline "main" test method)

* Migrate doctest for PrimeFactors.js

(also remove inline "main" test method)

* Migrate doctest for BogoSort.js

Re-write prototype-polluting helper methods, too.

(also remove inline test driver code)

* Migrate doctest for BeadSort.js

(also remove inline test driver code)

* Migrate doctest for BucketSort.js

(also remove inline test driver code)

* Migrate doctest for CocktailShakerSort.js

(also remove inline test driver code)

* Migrate doctest for MergeSort.js

(also remove inline test driver code)

* Migrate doctest for QuickSort.js

(also remove inline test driver code)

* Migrate doctest for ReverseString.js

(also remove inline test driver code)

* Migrate doctest for ReverseString.js

* Migrate doctest for ValidateEmail.js

* Migrate doctest for ConwaysGameOfLife.js

(remove the animate code, too)

* Remove TernarySearch doctest

Already migrated to jest

* Migrate doctest for BubbleSort.js

(also remove inline test driver code)

* Remove doctest from CI and from dependencies

relates to #742
fixes #586

* Migrate doctest for RgbHsvConversion.js

* Add --fix option to "standard" npm script

* Migrate doctest for BreadthFirstSearch.js

(also remove inline test driver code)

* Migrate doctest for BreadthFirstShortestPath.js

(also remove inline test driver code)

* Migrate doctest for EulerMethod.js

(also remove inline test driver code)

Move manual test-code for plotting stuff in the browser in a distinct file, too. Those "*.manual-test.js" files are excluded from the UpdateDirectory.mjs script, as well.

* Migrate doctest for Mandelbrot.js

(also remove inline test driver code & moved manual drawing test into a *.manual-test.js)

* Migrate doctest for FloodFill.js

* Migrate doctest for KochSnowflake.js

(also move manual drawing test into a *.manual-test.js)

* Update npm lockfile

* Update README and COMMITTING with a few bits & bobs regarding testing & code quality
2021-10-07 12:33:38 +05:30
83b840d691 Merge branch 'master' of github.com:charliejmoore/Javascript into cycle-sort-tests 2021-10-06 07:42:16 -04:00
2e6f8ae982 chore: Merge pull request #736 from charliejmoore/bucket-sort-tests
Bucket sort tests
2021-10-06 12:45:35 +05:30
6bb075df92 Group tests in a describe 2021-10-05 17:25:22 -04:00
6bba9da118 Group tests in a describe 2021-10-05 17:23:36 -04:00
519f557899 Add tests for CycleSort 2021-10-04 18:53:49 -04:00
7c0379c024 Add tests for CombSort 2021-10-04 18:43:54 -04:00
11315ea449 Add tests for BucketSort 2021-10-04 18:36:19 -04:00
0fea99db49 Update FisherYatesShuffle.test.js
Updated fisherYatesShuffle to FisherYatesShuffle
2021-10-03 20:10:56 +05:30
6b2840f579 Added Fisher Yates Algorithm 2021-10-03 15:40:45 +02:00
c198a9f53d Added test for ScrambleStrings and formatted folder structure for other folders 2021-10-03 17:28:17 +05:30