mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-07-05 03:18:55 +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-
|
${{ runner.os }}-node-
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
name: Install dependencies
|
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
|
- name: Test
|
||||||
run: npm test
|
run: npm test
|
||||||
lint:
|
lint:
|
||||||
|
@ -3,12 +3,13 @@ const request = require('request')
|
|||||||
const host = global.host || 'http://localhost:3000'
|
const host = global.host || 'http://localhost:3000'
|
||||||
|
|
||||||
console.log('注意: 测试登录需在 test/login.test.js 中填写账号密码!!!');
|
console.log('注意: 测试登录需在 test/login.test.js 中填写账号密码!!!');
|
||||||
|
const phone = ''
|
||||||
|
const password = ''
|
||||||
describe('测试登录是否正常', () => {
|
describe('测试登录是否正常', () => {
|
||||||
it('手机登录 code 应该等于200', done => {
|
it('手机登录 code 应该等于200', done => {
|
||||||
const qs = {
|
const qs = {
|
||||||
phone: phone,
|
phone: process.env.NCM_API_TEST_LOGIN_PHONE || phone || '',
|
||||||
password: password
|
password: process.env.NCM_API_TEST_LOGIN_PASSWORD || password || ''
|
||||||
}
|
}
|
||||||
|
|
||||||
request.get({url: `${host}/login/cellphone`, qs: qs}, (err, res, body) => {
|
request.get({url: `${host}/login/cellphone`, qs: qs}, (err, res, body) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user