[TEST] Use nock instead of jest for captcha mocking
Open
- Dominant language
- TypeScript
- Stars
- 7
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
Use this code in `test/utils.ts` to mock the captcha with `nock`.
```ts
export function mockCaptchaValidationOnce(action: RecaptchaActionType) {
nock('https://www.google.com').get('/recaptcha/api/siteverify').query(true).reply(200, {
success: true,
action,
score: 1,
});
}
export function mockCaptchaValidationWithScore(action: RecaptchaActionType, score: number) {
nock('https://www.google.com').get('/recaptcha/api/siteverify').query(true).reply(200, {
success: true,
action,
score,
});
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.