Created
March 6, 2022 13:25
-
-
Save slawekradzyminski/8f049c260d3321a69f1277c34718dec0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const registerUrl = 'http://localhost:4000/users/signup' | |
export const register = (user: User) => { | |
const registerResponse = http.post(registerUrl, registerBody(user), { | |
headers: jsonHeaders, | |
}); | |
check(registerResponse, { "is status 201": (r) => r.status === 201 }); | |
} | |
const registerBody = (user: User) => { | |
const body = { | |
firstName: user.firstName, | |
lastName: user.lastName, | |
username: user.username, | |
password: user.password, | |
email: user.email, | |
roles: ['ROLE_CLIENT'] | |
} | |
return JSON.stringify(body) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment