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

29: Tests with Vitest #84

Merged
merged 25 commits into from
Oct 12, 2023
Merged

29: Tests with Vitest #84

merged 25 commits into from
Oct 12, 2023

Conversation

RyanR712
Copy link
Collaborator

@RyanR712 RyanR712 commented Oct 7, 2023

.eslintrc.json - removed a no-unpublished-import error
package.json - added a test command for npm that runs vitest
vite.config.js - now includes reference to vitest
Rectangle.test.ts - functioning test, woohoo!
Please look over ASAP to make sure I didn't touch anything I shouldn't have.
Will update the README with instructions/common mistakes I made.
Going to merge master into this now as well.

.eslintrc.json - removed a no-unpublished-import error
package.json - added a test command for npm that runs vitest
vite.config.js - now includes reference to vitest
Rectangle.test.ts - functioning test, woohoo!
Please look over ASAP to make sure I didn't touch anything I shouldn'test
have.
Will update the README with instructions/common mistakes I made.
@RyanR712 RyanR712 self-assigned this Oct 7, 2023
@RyanR712 RyanR712 requested a review from James-Oswald October 7, 2023 11:00
@RyanR712 RyanR712 added the Enhancement New feature label Oct 7, 2023
@RyanR712 RyanR712 added this to the Sprint 10/9 milestone Oct 7, 2023
@RyanR712 RyanR712 changed the title One test working with vitest, config changes 29: Tests with Vitest Oct 7, 2023
@RyanR712 RyanR712 added the required This feature is required to be implemented by the current implementation team label Oct 7, 2023
@RyanR712 RyanR712 linked an issue Oct 7, 2023 that may be closed by this pull request
4 tasks
RyanR712 and others added 21 commits October 7, 2023 18:25
Odd note, if you try and put a tests folder in the root directory,
vitest looks for tests only in /src/ anyway.
Might have to do with something in vite.config.js? Line 6, maybe?
package.json - live-test and test are now separate commands
"npm run test" no longer requires the user to press q to quit

README.md - proper description of test
tsconfig.json - includes all .ts files in /tests/
Rectangle.test.ts - added second test to test vitest test test test
Ellipse.test.ts - added one test to test vitest with multiple test files
Point.ts - updated documentation
Created .yml file that runs all vitest tests
Point.test.ts:
tests for accurate construction,
setting new values to an existing Point,
and a Point's distance with itself

Point.ts - toString() now produces a string that looks like a Cartesian point, distance method moved here from EllipseCreation.ts
EllipseCreation.ts - moved the distance method to Point, changed a method call accordingly
Point.test.ts - test.each now compacts some otherwise repetitive testing committed
AEGTree.ts - added author tags and changed documentation
AtomNode.ts - changed documentation
All around - @author tags for me, so fake Ryan doesn't strike again
Point.ts - updated documentation for two functions, added isFinite() checks
Rectangle.ts - constructor now accepts null for a starting vertex,
toString() format change, documentation changes, isFinite() and positiveness checks

Point.test.ts - made more use of test.each, test.fails clauses to make sure some constructions fail
Rectangle.test.ts - additional basic tests, better organization via test.each
Rectangle.ts - added ?: to all parameters
Rectangle.test.ts - modified tests accordingly
Point.ts - slight documentation update
Rectangle.test.ts - added getCorners() and containsPoint() tests
AEGUtils.ts - pointInELlipse() => pointInEllipse(), changed function calls accordingly
Ellipse.ts - changed import and function call according to above
CutNode.ts - documentation for toFormulaString(), credited this "James Oswald" character
Rectangle.test.ts - changed containsPoint() tests to no longer expect points on the edges of Rectangles to pass
Rectangle.test.ts:
- condensed some string args sent to test()s
- overlaps, contains, toString describe() sections
- the tests only get more comprehensiver from here
Ellipse.ts - moved toString() to bottom of file, changed toString() format, added isFinite()/isPositive checking in constructor
Rectangle.test.ts - skeletons added for Rectangle-on-Ellipse contains()/overlaps() checking, small changes
Ellipse.test.ts - constructor, containsPoint(), toString(), Ellipse-on-Rectangle overlaps() and Ellipse-on-Rectangle contains() implementations, Ellipse-on-Ellipse skeletons
README.md - changed some excessive wording, added .npmignore to the source file explanation chunk
Rectangle.test.ts, Ellipse.test.ts - expanded on existing tests
Copy link
Member

Choose a reason for hiding this comment

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

I think we're good on rectangle.

@RyanR712 RyanR712 marked this pull request as ready for review October 12, 2023 14:45
@RyanR712 RyanR712 merged commit 9595463 into master Oct 12, 2023
4 of 5 checks passed
@RyanR712 RyanR712 deleted the 29-using-vitest-for-unit-testing branch October 16, 2023 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature required This feature is required to be implemented by the current implementation team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Typescript API Unit Tests For AEGs
2 participants