diff --git a/index.d.ts b/index.d.ts index f67413a..a607c37 100644 --- a/index.d.ts +++ b/index.d.ts @@ -20,6 +20,12 @@ type VerifyResponse = { /** List of error codes. Present if success is false */ "error-codes"?: string[], + + /** A score denoting malicious activity. (Optional b/c of ENTERPRISE feature) */ + score?: number, + + /** Reason(s) for score. (Optional b/c of ENTERPRISE feature) */ + score_reason?: string[], }; declare module "hcaptcha" { diff --git a/test/index.js b/test/index.js index 79cf342..208a5e8 100644 --- a/test/index.js +++ b/test/index.js @@ -79,7 +79,7 @@ describe('hCaptcha', function () { verify(secret, token) .then(done.fail) .catch(error => { - assert.strictEqual(error.message, 'Unexpected token < in JSON at position 0') + assert.match(error.message, /unexpected token/i); done() }); });