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

normalize tests #3

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

normalize tests #3

wants to merge 3 commits into from

Conversation

rijkerd
Copy link
Member

@rijkerd rijkerd commented Sep 19, 2019

No description provided.

import request from 'supertest';
import { expect, faker, clear, create } from '@lykmapipo/mongoose-test-helpers';
import { app, mount } from '@lykmapipo/express-common';
// import _ from 'lodash';
Copy link
Member

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', () => {
Copy link
Member

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');

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');
Copy link
Member

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')

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');
Copy link
Member

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

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');
Copy link
Member

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

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');
Copy link
Member

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

instance,
} = Account.schema.paths.accessors.schema.paths.verifiedAt;
it('should have verifiedAt field', () => {
const verifiedAt = Account.path('Account.accessors.verifiedAt');
Copy link
Member

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

expect(account.name).to.be.equal('account');
expect(account.length).to.be.equal(1);
});
describe('Account should be exported', () => {
Copy link
Member

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()

});
expect(Account).to.exist;
expect(Account.fetchAccount).to.exist;
describe('Account should be export Account', () => {
Copy link
Member

@lykmapipo lykmapipo Sep 20, 2019

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()

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