-
Notifications
You must be signed in to change notification settings - Fork 58
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
Draft: Add Jest and eslint #110
base: master
Are you sure you want to change the base?
Conversation
@@ -1,78 +1,81 @@ | |||
{ | |||
"name": "iamus-metaverse-server", | |||
"version": "2.4.10", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name should change to "vircadia-metaverse", the author should be upgraded to "contributors", and the URL should be changed to "https://git.hub/vircadia/vircadia-metaverse" but I will include all those changes in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of work getting the eslint rules passing. Great job.
Only one code suggestion.
test("addAccount, then geting it by ID, then removing it", () => { | ||
testDatab() | ||
.then(() => { | ||
const accExpected = mockAccount("test3"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than "mockAccount", you could use "Accounts.createAccount(user, pw)". This returns an AccountEntity with all the fields and doesn't update the database.
Adds and configures Jest and eslint (over the unsupported tslint) and begins to add some initial unit testing.
Since
eslint . --fix
and the.editorconfig
dropped cause a lot of mess in the diffs, here's a description of everything changed per commit:Add jest as a dependency
-- Simply addsjest
andts-jest
to the dev dependencies and adds a minimaljest.config.js
Replace tslint with eslint
did the following: add the.editorconfig
, addeslint
itself to the dev dependencies, copy the.eslintrc.js
directly from thevircadia-web-sdk
, and set up a minimal.eslintignore
Temporarily remove prebuild stage
removes linting from the build process temporarily. This is to be added again when the errors that cannot be--fix
ed have been solved.Update tslint inline comments to eslint inline comments
did a simple find and replace from/* tslint:disable-next-line */
to// eslint-disable-next-line
, however the.editorconfig
muddied the diffs some.Run eslint with --fix argument
does what it says on the tin, rewriting massive parts of the codebaseAdd util function to Db.ts for testing
adds one function for directly setting theDatab
global for use in unit tests, but again rewriting parts from the.editorconfig
.The final commits are relegated to their own files and can be reviewed easily by examining the diffs.