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

test中的app.mockSession #2231

Closed
muhm opened this issue Mar 19, 2018 · 5 comments · Fixed by eggjs/egg-mock#68
Closed

test中的app.mockSession #2231

muhm opened this issue Mar 19, 2018 · 5 comments · Fixed by eggjs/egg-mock#68

Comments

@muhm
Copy link

muhm commented Mar 19, 2018

用app.mockSession模拟session后,
如果测试对象中包含ctx.session.save(),
报错ctx.session.save is not a function

@atian25
Copy link
Member

atian25 commented Mar 20, 2018

fixed at eggjs/egg-mock#68

@muhm muhm closed this as completed Mar 20, 2018
@atian25
Copy link
Member

atian25 commented Mar 20, 2018

临时解决方式是你先自己加个方法 app.mockSession({ foo: 'bar', save() {} })

@muhm
Copy link
Author

muhm commented Mar 20, 2018

@atian25 哦,因为是自己写着玩,然后就直接改了node_modules下的文件

@atian25
Copy link
Member

atian25 commented Mar 20, 2018

node_modules 下的东西不要改~

@atian25
Copy link
Member

atian25 commented Mar 20, 2018

已发布,更新下依赖即可

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 a pull request may close this issue.

2 participants