feat(testing): add jest as unit test framework (#3517)#3518
Open
spectrum-branch wants to merge 1 commit into
Open
feat(testing): add jest as unit test framework (#3517)#3518spectrum-branch wants to merge 1 commit into
spectrum-branch wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Change
jestunit test framework to Firebot. An example unit test is staged there to allow running of tests with this foundation. This example test can be removed as "real" tests are added.rootDirintsconfig.jsonbeing set to'./src', as this does not cover the typical directory of the./testsfolder, so npm CLI commands would complain. In no way did I want to potentially affect how production builds function, so I did not dare changerootDir. If the devs decide to change this value, it could lead to a bit of unification of this configuration. I researched both vitest and jest for this situation as a bit of due diligence, and they both would be affected by this.npm init jest, in order to create the resultantjest.config.tsfile. This configuration can be changed as needed, and even be regenerated by running the samenpm init jestcommand again and giving different answers. The below includes the whole question/answer dialogue with the generator:I left behind the comments that were generated in the
jest.config.tsfile which detail the various options, but they could just as easily be removed. This is a good moment to discuss any changes to this configuration based on the preferences of the devs.Applicable Issues
#3517
Testing
npm run testwhich should run all tests. The application is intended to run normally/exactly the same as before.npm run ...scripts worked, includinglint,setup,build, andstart.Screenshots