未验证 提交 bc71f537 编写于 作者: A a632079

test: use env variable variables in login.test.js

上级 9aed8210
......@@ -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) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册