22 lines
680 B
JavaScript
22 lines
680 B
JavaScript
// SPDX-FileCopyrightText: 2024 Aravinth Manivannan <realaravinth@batsense.net>
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
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);
|
|
});
|
|
});
|