UNPKG

ynu-aaa

Version:

a 3A API Client for YNU

45 lines (43 loc) 1.37 kB
import { env } from 'node:process'; import * as cache from 'memory-cache'; // import { after, describe, it } from 'node:test'; import { equal, ok } from 'node:assert'; import { House } from '../src'; import {UserDetailQueryParams} from "../src/user/type/user_detail"; import 'dotenv/config' import {UserPasswordUpdateParams, UserUpdateParams} from "../src/user/type/user_update"; const { API_HOST } = env; const options = { host: API_HOST, }; describe('User-用户相关', function() { after(() => cache.clear()); it('用户详情', async () => { const params: UserDetailQueryParams = { user_name: "", } const res = await House.getUserDetail(params, options); console.log(res) ok(res.user_name != "") }); it('修改用户', async () => { const params: UserUpdateParams = { user_name: "", email: "" } const res = await House.updateUser(params, options); console.log(res) ok(res.code == 0) }); it('修改用户密码', async () => { const params: UserPasswordUpdateParams = { user_name: "", new_password: "" } const res = await House.updateUserPassword(params, options); console.log(res) ok(res.code == 0) }); });