Skip to content

Migrate doctests to Jest #742

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
defaude opened this issue Oct 5, 2021 · 4 comments · Fixed by #749
Closed
3 tasks done

Migrate doctests to Jest #742

defaude opened this issue Oct 5, 2021 · 4 comments · Fixed by #749
Labels
feature Adds a new feature help wanted Needs to be worked on in progress Being worked on

Comments

@defaude
Copy link
Contributor

defaude commented Oct 5, 2021

fixes #586

  • List all doctests below
  • Rewrite doctests in Jest
  • Remove doctest setup

List of doctests (batch 1)

Data-Structures/Array

  • QuickSelect

Maths

  • AverageMedian
  • BinaryExponentiationRecursive
  • EulersToient
  • PrimeFactors

Sorts

  • BogoSort
  • BeadSort
  • BucketSort
  • CocktailShakerSort
  • MergeSort
  • QuickSort

String

  • ReverseString
  • ReverseWord
  • ValidateEmail

List of doctests (batch 2)

Cellular-Automata

  • ConwaysGameOfLife.js

Search

  • TernarySearch

Sorts

  • BubbleSort

List of doctests (batch 3)

Conversions

  • RgbHsvConversion

Data-Structures/Vectors

  • Vector2

Graphs

  • BreadthFirstSearch
  • BreadthFirstShortestPath

Maths

  • EulerMethod
  • Mandelbrot

Recursive

  • FloodFill
  • KochSnowflake
@cclauss
Copy link
Member

cclauss commented Oct 5, 2021

Using the fixes syntax above will cause GitHub to autoclose the issue when this PR lands.

@defaude
Copy link
Contributor Author

defaude commented Oct 5, 2021

I've migrated batch 1 & 2, but now it's already 1am and I need to go to bed ;)

@FabianKielmann
Copy link
Contributor

Since this issue was tagged with "help wanted", I made a pull request for the Vector2.js. But now I'm uncertain if I threw a spanner in the works of @defaude. If so, please let me know. And sorry.

@defaude
Copy link
Contributor Author

defaude commented Oct 6, 2021

Don't panic :) I took a look at your PR and left a few suggestions. You were first, so you should get credits for the Vector2 thingy :)

raklaptudirm pushed a commit that referenced this issue Oct 7, 2021
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Adds a new feature help wanted Needs to be worked on in progress Being worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants