Skip to content

RikkertTheDeveloper/Flask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask Suite


The extensible JavaScript testing suite.
Written by Rick Arendsen

⚗️ What is Flask Suite?

Flask suite is a lightweight zero-overhead JavaScript testing suite, able to be set up in a matter of minutes. I wrote this package because I wanted to see what the a lightweight testing suite would look like, and how I would be able to build one.

I have always been a big, big fan of test-driven development, and I would like to recommend all developers, independant or enterprise to integrate it into your workflow. I hope my suite will be of some use by bringing a very flexible yet easy to use API to the TTD field.


🏗️ How do I set up Flask Suite?

- Setting up the package:

To get started, simply run npm i flask-suite inside of your terminal. This will install all code required to use the suite. When you have ran the command simply run: npm exec flask, this will run the entry point of the flask suite.

Upon first running the suite, you will most likely see a message along the lines of: Flask.js - Successfully generated flask.config.js file.. When you see this message, you are ready to start setting up your test suite.

- Creating and locating the tests folder.

Once you have set up the package, create your 'tests' folder in any directory you want. Just make sure that the path matches to your flask.config.js file. Otherwise the suite will throw an error. Once you have the tests folder in the right directory and it maps to the correct location from the flask.config.js file. you are ready to start testing.

Run npm exec flask inside of your terminal, and you will see that the test suite is functioning, now let's start making some tests!

- Making tests

Now that we are able to run the tests, lets start creating our own. Tests in flask-suite run in a way where the output of the test can be dictated by 'true' or 'false', or by using the bult-in assertions, using this method we are able to create some tests, here is an example of a flask-suite test:
function run() {
    const myTestVariable = "Hello, world!";
    return (myTestVariable == "Hello, world!")
}

exports.default = run;

Upon running this code, this test will succeed. You can also make use of the built-in @flask/flask-globals library, this libary provides useful assertions to hopefully make your life easier. Please keep in mind that any test which errors in the suite will automatically assume itself as 'failed'


👷🏻 Contributing

If you would like to contribute to the project, or report any issues or bugs or you would like to request a feature you would like to see. Please see the GitHub repository for more information.

About

An extensible testing suite for the JavaScript ecosystem.

Topics

Resources

Stars

Watchers

Forks