mirror of
https://github.com/pieartsy/PluralFlux.git
synced 2026-04-14 20:15:28 +10:00
test setup for messagehelper and webhookhelper
This commit is contained in:
33
tests/helpers/messageHelper.test.js
Normal file
33
tests/helpers/messageHelper.test.js
Normal file
@@ -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();
|
||||
});
|
||||
})
|
||||
27
tests/helpers/webhookHelper.test.js
Normal file
27
tests/helpers/webhookHelper.test.js
Normal file
@@ -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();
|
||||
});
|
||||
})
|
||||
Reference in New Issue
Block a user