wip
This commit is contained in:
@@ -99,9 +99,17 @@ export const relativeFetch = async (path: string, init?: RequestInit | undefined
|
||||
return await fetch(new URL(path, `http://127.0.0.1:${port}/`).toString(), init);
|
||||
};
|
||||
|
||||
function randomString(chars = 'abcdefghijklmnopqrstuvwxyz0123456789', length = 16) {
|
||||
let randomString = '';
|
||||
for (let i = 0; i < length; i++) {
|
||||
randomString += chars[Math.floor(Math.random() * chars.length)];
|
||||
}
|
||||
return randomString;
|
||||
}
|
||||
|
||||
export const signup = async (params?: Partial<misskey.Endpoints['signup']['req']>): Promise<NonNullable<misskey.Endpoints['signup']['res']>> => {
|
||||
const q = Object.assign({
|
||||
username: 'test',
|
||||
username: randomString(),
|
||||
password: 'test',
|
||||
}, params);
|
||||
|
||||
|
Reference in New Issue
Block a user