normalize tests#3
Open
rijkerd wants to merge 3 commits into
Open
Conversation
lykmapipo
reviewed
Sep 20, 2019
| import request from 'supertest'; | ||
| import { expect, faker, clear, create } from '@lykmapipo/mongoose-test-helpers'; | ||
| import { app, mount } from '@lykmapipo/express-common'; | ||
| // import _ from 'lodash'; |
lykmapipo
reviewed
Sep 20, 2019
| const { instance } = Account.schema.paths.accessors; | ||
| const { tree } = Account.schema.tree.accessors[0]; | ||
| describe('Account Accessor Schema', () => { | ||
| it('should be an array of embedded subdocuments', () => { |
Member
There was a problem hiding this comment.
This supposed to be Account.path('accessors');
lykmapipo
reviewed
Sep 20, 2019
| const { name } = Account.schema.tree.accessors[0].tree; | ||
| const { instance } = Account.schema.paths.accessors.schema.paths.name; | ||
| it('should have name field', () => { | ||
| const name = Account.path('Account.accessors.name'); |
Member
There was a problem hiding this comment.
This supposed to be Account.path('accessors.name')
lykmapipo
reviewed
Sep 20, 2019
| const { phone } = Account.schema.tree.accessors[0].tree; | ||
| const { instance } = Account.schema.paths.accessors.schema.paths.phone; | ||
| it('should have phone field', () => { | ||
| const phone = Account.path('Account.accessors.phone'); |
Member
There was a problem hiding this comment.
Remove Account on get phone field
lykmapipo
reviewed
Sep 20, 2019
| const { email } = Account.schema.tree.accessors[0].tree; | ||
| const { instance } = Account.schema.paths.accessors.schema.paths.email; | ||
| it('should have email field', () => { | ||
| const email = Account.path('Account.accessors.email'); |
Member
There was a problem hiding this comment.
Remove Account on get email field
lykmapipo
reviewed
Sep 20, 2019
| const { locale } = Account.schema.tree.accessors[0].tree; | ||
| const { instance } = Account.schema.paths.accessors.schema.paths.locale; | ||
| it('should have locale field', () => { | ||
| const locale = Account.path('Account.accessors.locale'); |
Member
There was a problem hiding this comment.
Remove Account on get locale field
lykmapipo
reviewed
Sep 20, 2019
| instance, | ||
| } = Account.schema.paths.accessors.schema.paths.verifiedAt; | ||
| it('should have verifiedAt field', () => { | ||
| const verifiedAt = Account.path('Account.accessors.verifiedAt'); |
Member
There was a problem hiding this comment.
Remove Account on get verifiedAt field
lykmapipo
reviewed
Sep 20, 2019
| expect(account.name).to.be.equal('account'); | ||
| expect(account.length).to.be.equal(1); | ||
| }); | ||
| describe('Account should be exported', () => { |
Member
There was a problem hiding this comment.
This has to be a test case i.e use it()
lykmapipo
reviewed
Sep 20, 2019
| }); | ||
| expect(Account).to.exist; | ||
| expect(Account.fetchAccount).to.exist; | ||
| describe('Account should be export Account', () => { |
Member
There was a problem hiding this comment.
This has to be a test case i.e use it()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.