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

support __skipRender #11

Merged
merged 2 commits into from
Aug 26, 2015
Merged

support __skipRender #11

merged 2 commits into from
Aug 26, 2015

Conversation

atian25
Copy link
Contributor

@atian25 atian25 commented Aug 24, 2015

sometime, we use js to render pages.
when mock, we need to add __scene to referer, but don't mock the view render, only mock ajax render

}
yield this.render(view, data);
} else {
console.log(this.state)
Copy link
Member

Choose a reason for hiding this comment

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

remove console.log

Copy link
Member

Choose a reason for hiding this comment

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

if (data.__skipRender) is better than if (!data.__skipRender).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

if (!view || IS_JSON_RE.test(this.path)) {
return this.body = data;
if (data.__skipRender) {
yield* next;
Copy link
Member

Choose a reason for hiding this comment

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

return yield* next

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, need to inject

@atian25
Copy link
Contributor Author

atian25 commented Aug 25, 2015

@fengmk2 any other problem?

@fengmk2
Copy link
Member

fengmk2 commented Aug 26, 2015

+1

fengmk2 added a commit that referenced this pull request Aug 26, 2015
@fengmk2 fengmk2 merged commit b3a648f into koajs:master Aug 26, 2015
@fengmk2
Copy link
Member

fengmk2 commented Aug 26, 2015

Great job!

@fengmk2 fengmk2 self-assigned this Aug 26, 2015
@fengmk2
Copy link
Member

fengmk2 commented Aug 26, 2015

koa-mock@1.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants