From fe8dbadff4e61bdd841cf975dba9e4736ada8f89 Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Wed, 3 Jan 2024 01:06:57 +0530 Subject: [PATCH] feat: test verification method against test mcaptcha instance --- src/index.test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/index.test.js diff --git a/src/index.test.js b/src/index.test.js new file mode 100644 index 0000000..d3d6384 --- /dev/null +++ b/src/index.test.js @@ -0,0 +1,16 @@ +const MCaptcha = require("./index"); +require("dotenv").config({ path: ".env.local" }); +const assert = require("assert").strict; + +describe("test mCaptcha client", async function () { + it("should be able verify authorization token", async function () { + let mcaptcha = new MCaptcha( + process.env.SITEKEY, + process.env.SECRET, + process.env.INSTANCE_URL + ); + let res = await mcaptcha.verify(process.env.TOKEN); + console.log(`verification status: ${res}`); + assert.strictEqual(res, true); + }); +});