- Helps to test your bot or application without using a real
Slack
server. It is also useful for writing integration ande2e
tests.
- In order to set up the working environment you need:
Docker
application for your OS, you can download here https://docs.docker.com/install/
- Clone this project to your favorite location using command (for example):
git clone https://github.com/maddevsio/mad-fake-slack.git
- Next, you need to install
VSCode
- Here are 3 quick steps to get started doing Visual Studio Code Remote Development:
- Install the stable version of VSCode
- Get the Remote Development Extension Pack, which installs support for WSL, SSH, and Containers and is the easiest way to get started. If you don't need them all, you can uninstall the individual extensions.
- Read the Docs. Try the Dev Container samples.
- Next you need to open the project in
VSCode
- Watch Remote-Containers on YouTube
Reopen in Container
popup message will appear.VSCode
restarts and begins to create and configure containers. (Check that Docker service has been started)- Then you can open VSCode terminal, which, if everything is successful, will be connnected to the docker container for development, with all necessary tools installed in it. You will see a greeting like
root@e6e415dc0d02: /workspace
or#/
in the case of/bin/sh
. - Now you can work on project.
VSCode
is connected to the environment in the docker.
- Here are 3 quick steps to get started doing Visual Studio Code Remote Development:
- In the current terminal VSCode, execute the command
npm start
- After that go to the URL
http://localhost:9001
in the browser (The current simple Fake Slak interface will be displayed) - To demonstrate, you need to open another remote terminal VSCode and execute the command
npm run example:rtmbot
(This command will run simple client bot application) - Then you will see in
UI
at the addresshttp://localhost:9001
a message from the bot. If you type a message and send it to the bot (using Enter or the "Send" button, you will receive an answer, with your message back).
- For executing integration tests was used
jest-puppeeter
.jest
used as platform for writing tests in consolidation with power ofpuppeeter
- You need to run command inside VSCode console
npm run example:rtmbot:integration
- Now supported following test api methods:
GET
/api/db/reset
- resets current db (If you will refresh mad-fake-slack ui in your browser, you will see that your conversational data has disappeared)GET
/api/db/current/team?domain=NEW_DOMAIN_VALUE
- Sets the domain value for the current team (by default, value forteam.domain
equal tolocalhost:9001
). Affects the domain for the URL when constructing a websocket url and workspace url.