tbo47 / dagre-es

The dagrejs library exported as ES modules.
Other
32 stars 14 forks source link

Add unit tests for `src/dagre` from upstream `dagre` project #21

Closed aloisklink closed 1 year ago

aloisklink commented 1 year ago

Add unit tests for dagre from the upstream https://github.com/dagrejs/dagre/commit/103136b04a13c7ac10d8ded25954da58d5ed88e1. This is mainly to ensure that we don't break anything in the future, if we do any refactoring.

I've had to some minor changes to get them working with dagre-es:

The tests are automatically run using npm test and in GitHub Actions.


By the way, I know this PR has a lot of files changed! I've tried to split it up into logical commits to make it easier to review! E.g. commit https://github.com/tbo47/dagre-es/commit/b7513fcf156c4c852cb58a2eb769e4da596d3a83 can be mostly ignored, since I just copied the files from https://github.com/dagrejs/dagre (although I did rename them).

tbo47 commented 1 year ago

Thank you so much for doing this! This is awesome.

aloisklink commented 1 year ago

Thank you so much for doing this! This is awesome.

No worries, thanks for giving a review! :smile:

Ideally I also want to add tests from https://github.com/dagrejs/graphlib and tests from https://github.com/dagrejs/dagre-d3, starting with unit tests, and maybe browser tests too.

It's mainly just to make sure that we haven't broken anything! (and that we won't break anything in the future)