Commit Graph

16 Commits

Author SHA1 Message Date
7fead5e3d7 feat: Add unit tests (#21)
Tests are mostly complete (though some are failing -- to be fixed in the
async/await refactor.

Also refactored, fixed bugs found while testing, and added ability to
type `pf;m` instead of `pf;member`.

---------

Co-authored-by: Aster Fialla <asterfialla@gmail.com>
2026-02-24 12:42:23 -05:00
8fc590c062 feat: add tests and other such features (#3)
* converted import syntax to ES modules

removed unused methods

* got test sort of working (jest set up is not crashing but also not mocking correctly)

* adjusted beforeeach/beforeall so more pass

* more correct test setup

* converted import syntax to commonJS

removed unused methods

* got test sort of working (jest set up is not crashing but also not mocking correctly)

* adjusted beforeeach/beforeall so more pass

* more correct test setup

* more correct dockerfile and compose.yaml

* Revert "converted import syntax to commonJS"

This reverts commit 5ab0d62b

* updated jest to sort of work with es6

* separating out enum return from method return

* mostly working except for the weirdest error

* nevermind it wasn't actually working, gonna move on for now

* added babel to convert es modules to cjs

* finally figured out issue with tests (referencing the method directly in the test.each calls the real method not the mock in beforeEach())

* setup fixed more

* added error handling parseMemberCommand test

* renamed db to database
more tests and fixing logic for memberhelper

* upgraded fluxer.js

* moved import to helpers folder

* moved import to helpers folder

* more tests for member helper

* think i fixed weird error with webhook sending error when a user has no members

* simplified sendMessageAsAttachment

* added return to addFullMember so that addNewMember can reference it properly in strings

* test setup for messagehelper and webhookhelper

* readded line i shouldn't have removed in sendMessageAsMember

* fixed test and logic

* added test for memberHelper

* updated sendMessageAsAttachment to returnBufferFromText and updated commands/webhookHelper accordingly

* added tests for parseProxyTags and updated logic

* added "return" so tests dont terminate on failure and deleted env.jest

* finished tests for messageHelper!

* more cases for messageHelper just in case

* updating docstring for messageHelper parseProxyTags

* more tests for webhookhelper

* deleted extra file added during merge

* removed confusing brackets from enum docs

* finally mocking correctly

* adding more cases to messageHelper tests

* updating enums

* removed error response when proxy is sent without content

* , updated tests for webhookHelper and removed error response when proxy is sent without content

* added debounce to count guilds properly

* added todo note

* added tests for updateDisplayName

* edited help message trigger for updatePropic

* update message helper test to include space case

* update bot to suppress errors from API

* fixed bug for import not sending help text, added help text if you type a unrecognized command

* updated to be enum

* updated member helper and tests

* edit enums, tweak import content command

* removed unnecessary await and console.log

* made it easier to make a member

* added nicer error listing to importHelper

* updated documentation

* Merge branch 'main' of https://github.com/pieartsy/PluralFlux into add-tests

---------

Co-authored-by: Aster Fialla <asterfialla@gmail.com>
2026-02-19 21:45:10 -05:00
Aster Fialla
a3c3eb1545 added dotenv 2026-02-16 10:36:38 -05:00
Aster Fialla
fa86606fb4 added helper to rerun app when it crashes 2026-02-15 23:09:27 -05:00
Aster Fialla
f81da5ac27 added handler to send string as an attachment if it's too long 2026-02-15 16:20:42 -05:00
Aster Fialla
85d876f660 removed gateway check since I probably do not need it 2026-02-15 15:05:08 -05:00
Aster Fialla
dedd50adfc More simplified approach to loading images 2026-02-15 01:17:06 -05:00
Aster Fialla
7ef2adc689 updated package.json, moved stuff into src folder 2026-02-14 22:15:49 -05:00
Aster Fialla
a2c0530118 adding jest and jest files 2026-02-14 22:15:49 -05:00
Aster Fialla
68629fd75d adding jest 2026-02-14 22:15:49 -05:00
Aster Fialla
bf155d28b4 updated fluxer.js 2026-02-14 22:15:49 -05:00
Aster Fialla
0708622045 update dependencies to remove discord.js & linter 2026-02-14 22:15:49 -05:00
Aster Fialla
8b3be16cea updated package.json 2026-02-14 22:15:49 -05:00
Aster Fialla
9b73997c05 refactoring to use fluxer.js 2026-02-14 22:15:49 -05:00
Aster Fialla
fb5de122f0 added canvas package 2026-02-14 00:21:51 -05:00
pieartsy
fbee6d71f0 discord js (#1)
* clear out fluxer.net

* basic discord.js bot with ping, and echo

* added creation of webhook

* simplifying webhook logic

* sending messages as webhook

* deleting orignal message

* adding sequelize file

* commented out pgadmin part while it's not working

* adding member sort of working

* changing names of values

* updating names of values and adding new method in memberHelper

* renamed messagehelper function

* deleted proxyhelper

* passed only channel id into webhook helper methods

* added new functions and got update working

* changed message match to better reducer

* adjusted webhook helper to use actual data

* refactored bot.js and removed unused methods
2026-02-13 18:20:29 -05:00