Skip to content
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

tests for coverage #1825

Merged
merged 11 commits into from
Aug 23, 2023
Merged

tests for coverage #1825

merged 11 commits into from
Aug 23, 2023

Conversation

Fil
Copy link
Contributor

@Fil Fil commented Aug 23, 2023

Now that we have test:coverage, it becomes easier to add more tests.

From the starting point of (#1818):

----------------------|---------|----------|---------|---------|
File                  | % Stmts | % Branch | % Funcs | % Lines |
----------------------|---------|----------|---------|---------|
All files             |   95.54 |    89.37 |   92.78 |   95.54 |

Current status:

All files             |   95.66 |    89.65 |    92.8 |   95.66 |

(It doesn’t look like much, but each addition is worth it!)

Copy link
Member

@mbostock mbostock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made some changes:

  1. I folded the tests into the parent class or function. For example we already had tests for the line mark’s curve option, so I moved these new tests to be adjacent.
  2. I changed the test descriptions to match the current pattern (which is mostly method(...arguments) does something).
  3. I adopted TypeScript for the tests whenever possible. (We should file an issue for going back and moving all the tests to TypeScript, but we’ll need to use a lot of as any to test the undocumented implementation.)
  4. I adopted jsdom.js; the eliminates the need for instantiating JSOM and manually passing the document option to Plot.

@mbostock mbostock marked this pull request as ready for review August 23, 2023 22:55
@mbostock mbostock enabled auto-merge (squash) August 23, 2023 22:56
@mbostock mbostock merged commit dbf913b into main Aug 23, 2023
1 check passed
@mbostock mbostock deleted the fil/more-tests branch August 23, 2023 22:58
chaichontat pushed a commit to chaichontat/plot that referenced this pull request Jan 14, 2024
* stack rejects an invalid order

* these tests used the default labelAnchor

* test curve tension

* coverage: valid and invalid curves

* move curve tests to a features directory

* test channel scales: false, invalid

* invalid domain sort options

* The aspectRatio option rejects unsupported scale type

* test style

* test polish

* add missing test

---------

Co-authored-by: Mike Bostock <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants