From 5c01f2e2845c8b8b26f9f6e0fc6faf93825691af Mon Sep 17 00:00:00 2001 From: Aster Fialla Date: Wed, 18 Feb 2026 00:28:18 -0500 Subject: [PATCH] test setup for messagehelper and webhookhelper --- tests/helpers/messageHelper.test.js | 33 +++++++++++++++++++++++++++++ tests/helpers/webhookHelper.test.js | 27 +++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 tests/helpers/messageHelper.test.js create mode 100644 tests/helpers/webhookHelper.test.js diff --git a/tests/helpers/messageHelper.test.js b/tests/helpers/messageHelper.test.js new file mode 100644 index 0000000..64b8917 --- /dev/null +++ b/tests/helpers/messageHelper.test.js @@ -0,0 +1,33 @@ +jest.mock('../../src/helpers/memberHelper.js') +jest.mock('tmp'); +jest.mock('fs'); +jest.mock('@fluxerjs/core', () => jest.fn()); + +const {memberHelper} = require("../../src/helpers/memberHelper.js"); +const {Message} = require("@fluxerjs/core"); +const {fs} = require('fs'); +const {enums} = require('../../src/enums'); +const {tmp, setGracefulCleanup} = require('tmp'); +const {messageHelper} = require("../../src/helpers/memberHelper.js"); +const {describe} = require("pm2"); + +describe('messageHelper', () => { + const authorId = "0001"; + const authorFull = "author#0001"; + const attachmentUrl = "../oya.png"; + const attachmentExpiration = new Date('2026-01-01T00.00.00.0000Z') + + beforeEach(() => { + jest.resetModules(); + jest.clearAllMocks(); + }) + + describe(`parseProxyTags`, () => { + + }) + + afterEach(() => { + // restore the spy created with spyOn + jest.restoreAllMocks(); + }); +}) \ No newline at end of file diff --git a/tests/helpers/webhookHelper.test.js b/tests/helpers/webhookHelper.test.js new file mode 100644 index 0000000..47f85d4 --- /dev/null +++ b/tests/helpers/webhookHelper.test.js @@ -0,0 +1,27 @@ +jest.mock('../../src/helpers/messageHelper.js') +jest.mock('@fluxerjs/core', () => jest.fn()); + +const {messageHelper} = require("../../src/helpers/messageHelper.js"); +const {Message, Webhook, Channel} = require("@fluxerjs/core"); +const {webhookHelper} = require("../../src/helpers/webhookHelper.js"); + +describe('webhookHelper', () => { + const authorId = "0001"; + const authorFull = "author#0001"; + const attachmentUrl = "../oya.png"; + const attachmentExpiration = new Date('2026-01-01T00.00.00.0000Z') + + beforeEach(() => { + jest.resetModules(); + jest.clearAllMocks(); + }) + + describe(`sendMessageAsMember`, () => { + + }) + + afterEach(() => { + // restore the spy created with spyOn + jest.restoreAllMocks(); + }); +}) \ No newline at end of file