A Node Server written in Typescript and designed to get you quickly building Slackbots with Botkit + the Slack adapter.
Set up A URL for the OAuth redirect you will need once your slack wprkspace and app are set up
Rename example.env
to .env
Set Up Slack
Node Version Manager and version 14.1.0
After cloning the project, in your terminal:
Install dependencies $ yarn install
$ dc up
. This builds and starts the containers for development.
This app is set up for TDD. To begin, access the server's (node app's) command line:
$ docker exec -it server bash
Start the test suite:
$ yarn test:watch
This will re-run the test suite after every save and produce a coverage reportThe test framework is Jest.
Code Coverage Goal is to test 80% of functions with unit tests. You can adjust the coverage report in jest.config.js
TRIM will test 100% of Conversations with an integration test
Example: Booking a meeting
NOTE: Be careful and avoid testing the conversation's many possible variations/flow within an integration test. Use a unit test to test the various possibilities instead.
To ignore a directory or file in the coverage report, add the appropriate regex/path to the coveragePathIgnorePatterns
array in jest.config.js
. More Here.
To test persisted objects this reposotory uses a Jest preset for mongodb-memory-server. This preset sets the process.env.MONGO_URL for your convenience. FYI, This preset will initiate a download of mongo when you first run your test suite. Subsequent iterations will not do this.
$ docker exec -it bot-server bash
> yarn add <lib>
> exit
$ docker-compose down
$ docker-compose up --build