-
Notifications
You must be signed in to change notification settings - Fork 0
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
normalize tests #3
base: develop
Are you sure you want to change the base?
Conversation
import request from 'supertest'; | ||
import { expect, faker, clear, create } from '@lykmapipo/mongoose-test-helpers'; | ||
import { app, mount } from '@lykmapipo/express-common'; | ||
// import _ from 'lodash'; |
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.
Remove comment
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', () => { |
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.
This supposed to be Account.path('accessors');
test/unit/accessors.schema.spec.js
Outdated
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'); |
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.
This supposed to be Account.path('accessors.name')
test/unit/accessors.schema.spec.js
Outdated
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'); |
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.
Remove Account
on get phone field
test/unit/accessors.schema.spec.js
Outdated
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'); |
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.
Remove Account
on get email field
test/unit/accessors.schema.spec.js
Outdated
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'); |
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.
Remove Account
on get locale field
test/unit/accessors.schema.spec.js
Outdated
instance, | ||
} = Account.schema.paths.accessors.schema.paths.verifiedAt; | ||
it('should have verifiedAt field', () => { | ||
const verifiedAt = Account.path('Account.accessors.verifiedAt'); |
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.
Remove Account
on get verifiedAt field
test/unit/index.spec.js
Outdated
expect(account.name).to.be.equal('account'); | ||
expect(account.length).to.be.equal(1); | ||
}); | ||
describe('Account should be exported', () => { |
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.
This has to be a test case i.e use it()
test/unit/index.spec.js
Outdated
}); | ||
expect(Account).to.exist; | ||
expect(Account.fetchAccount).to.exist; | ||
describe('Account should be export Account', () => { |
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.
This has to be a test case i.e use it()
No description provided.