小黑小波比.nodejs功能测试

Nodejs 专栏收录该内容
51 篇文章 0 订阅
zmzp@zmzp1:~/data/s910$ node single --test
Default Log Start...
x86 don't support memwatch
test> 
可使用下列命令:
	@login app.task.action a:b ;功能调用测试
	@api.app.task.action a=b   ;功能调用测试
	unit <times>               ;为一个目录进行测试
	unit <times>.<testfile>    ;为一个文件进行单元测试
	jshint api                 ;为API目录检测js代码质量
	jshint app                 ;为APP目录检测js代码质量
test> @api.admin.passwordrecover.tel tel=22222
查到了!
===ERROR:2014-9-9T21:10:4星期二 
uncaught_exception:ReferenceError: alert is not defined
    at _.sql.query.success.failure.e.result.status (/home/zmzp/data/s910/app/admin/passwordrecover.js:55:5)
    at Object.callback.success (/home/zmzp/data/s910/Server/core/core.js:154:5)
    at Object.callback.success (/home/zmzp/data/s910/api/common/biz.js:133:9)
    at null.callback (/home/zmzp/data/s910/api/common/biz.js:258:14)
    at Query.handleReadyForQuery (/home/zmzp/data/s910/Server/node_modules/pg/lib/query.js:82:10)
    at null.<anonymous> (/home/zmzp/data/s910/Server/node_modules/pg/lib/client.js:159:19)
    at emit (events.js:117:20)
    at Socket.<anonymous> (/home/zmzp/data/s910/Server/node_modules/pg/lib/connection.js:109:12)
    at Socket.emit (events.js:95:17)
    at Socket.<anonymous> (_stream_readable.js:764:14)
=========

===OUTPUT:2014-9-9T21:10:4星期二 
test worker will exit...
=========

===OUTPUT:2014-9-9T21:10:5星期二 
test worker exit...
=========

===OUTPUT:2014-9-9T21:10:5星期二 
test request total : 0
=========

zmzp@zmzp1:~/data/s910$ node single --test
Default Log Start...
x86 don't support memwatch
test> @api.admin.passwordrecover.tel tel=22222
查到了!
226789
{"status":1}
time:43ms ops:23.25581395348837
test> @api.admin.passwordrecover.tel tel=22222
[]
724835
{"status":1}
time:29ms ops:34.48275862068966
test> @api.admin.passwordrecover.tel tel=123
[ { ucode: '00259ccde0-257b-4fb9-a341-5ef5c2642cad',
    email: null,
    telphone: '123',
    uname: '123',
    usex: null,
    utype: 1,
    upassword: 'PK/kD5K+asd9J5K0smfC2hHj8wh7k7sZxsUTN4aYS0Q=',
    ucreate: '463205279467',
    status: 1 } ]
474602
{"status":1}
time:31ms ops:32.25806451612903
test> 
</pre><pre name="code" class="plain">
zmzp@zmzp1:~/data/s910$ node single -test
Default Log Start...
x86 don't support memwatch
test> @api.admin.passwordrecover.code StuPhone=15198943477 ValidateCode=123
成功![object Object]
{"status":1}
time:58ms ops:17.24137931034483
test> @api.admin.passwordrecover.code StuPhone=15198943477 ValidateCode=123
1
成功![object Object]
{"status":1}
time:15ms ops:66.66666666666667
test> @api.admin.passwordrecover.code StuPhone=15198943477 ValidateCode=asdbcxzcv
1
成功![object Object]
{"status":1}
time:32ms ops:31.25
test> @api.admin.passwordrecover.code StuPhone=15198943477 ValidateCode=asdbcxzcv
[{"a":"0"}]
成功![object Object]
{"status":1}
time:8ms ops:125
test> @api.admin.passwordrecover.code StuPhone=15198943477 ValidateCode=asdbcxzcv
[]
验证码不正确!请仔细核对!
{"status":2}
time:31ms ops:32.25806451612903
test> @api.admin.passwordrecover.code StuPhone=15198943477 ValidateCode=asdbcxzcv
[]
验证码不正确!请仔细核对!
{"status":2}
time:5ms ops:200
test> Exit tester!
zmzp@zmzp1:~/data/s910$ 

1.当多个参数值,参数与参数之间加个空格.

test> @api.admin.passwordrecover.code StuPhone=15198943477 ValidateCode=asdbcxzcv

2.在服务端js的参数,要定义e.params.xxxx 不要直接写参数名

  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

©️2021 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值