mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-07-03 06:52:08 +08:00
test: use env variable variables in login.test.js
This commit is contained in:
parent
9aed821057
commit
bc71f537ad
4
.github/node.js.yml
vendored
4
.github/node.js.yml
vendored
@ -26,6 +26,10 @@ jobs:
|
||||
${{ runner.os }}-node-
|
||||
- run: npm ci
|
||||
name: Install dependencies
|
||||
- name: Set Test Env
|
||||
run: |
|
||||
export NCM_API_TEST_LOGIN_PHONE=${{ secrets.NCM_API_TEST_LOGIN_PHONE }}
|
||||
export NCM_API_TEST_LOGIN_PASSWORD=${{ secrets.NCM_API_TEST_LOGIN_PASSWORD }}
|
||||
- name: Test
|
||||
run: npm test
|
||||
lint:
|
||||
|
@ -3,12 +3,13 @@ const request = require('request')
|
||||
const host = global.host || 'http://localhost:3000'
|
||||
|
||||
console.log('注意: 测试登录需在 test/login.test.js 中填写账号密码!!!');
|
||||
|
||||
const phone = ''
|
||||
const password = ''
|
||||
describe('测试登录是否正常', () => {
|
||||
it('手机登录 code 应该等于200', done => {
|
||||
const qs = {
|
||||
phone: phone,
|
||||
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) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user