mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2026-10-24 00:21:23 +08:00
代码格式化
This commit is contained in:
+16
-14
@@ -2,25 +2,27 @@ const assert = require('assert')
|
||||
const request = require('request')
|
||||
const host = global.host || 'http://localhost:3000'
|
||||
|
||||
console.log('注意: 测试登录需在 test/login.test.js 中填写账号密码!!!');
|
||||
console.log('注意: 测试登录需在 test/login.test.js 中填写账号密码!!!')
|
||||
const phone = ''
|
||||
const password = ''
|
||||
describe('测试登录是否正常', () => {
|
||||
it('手机登录 code 应该等于200', done => {
|
||||
it('手机登录 code 应该等于200', (done) => {
|
||||
const qs = {
|
||||
phone: process.env.NCM_API_TEST_LOGIN_PHONE || phone || '',
|
||||
password: process.env.NCM_API_TEST_LOGIN_PASSWORD || password || ''
|
||||
phone: process.env.NCM_API_TEST_LOGIN_PHONE || phone || '',
|
||||
password: process.env.NCM_API_TEST_LOGIN_PASSWORD || password || '',
|
||||
}
|
||||
|
||||
request.get({url: `${host}/login/cellphone`, qs: qs}, (err, res, body) => {
|
||||
if (!err && res.statusCode == 200) {
|
||||
body = JSON.parse(body)
|
||||
assert(body.code === 200)
|
||||
done()
|
||||
}
|
||||
else{
|
||||
done(err)
|
||||
}
|
||||
})
|
||||
request.get(
|
||||
{ url: `${host}/login/cellphone`, qs: qs },
|
||||
(err, res, body) => {
|
||||
if (!err && res.statusCode == 200) {
|
||||
body = JSON.parse(body)
|
||||
assert(body.code === 200)
|
||||
done()
|
||||
} else {
|
||||
done(err)
|
||||
}
|
||||
},
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user