open-index/open-npm huggingface dataset:
npm package: @slack-wrench/bolt-storage-file
Description: Test bolt db using a local file system.
Latest version: 1.3.0

# Bolt File Storage

Bolt [conversation store](https://slack.dev/bolt/concepts#conversation-store) that uses your file system as a database.

This package is intended to be used in development to retain conversation state through restarts of your app.

## Install

```bash
# Yarn
yarn add --dev @slack-wrench/bolt-storage-file

# npm
npm install --save-dev @slack-wrench/bolt-storage-file
```

## Usage

```typescript
import { App } from '@slack/bolt';
import FileStore from '@slack-wrench/bolt-storage-file';

const app = new App({ convoStore: new FileStore() });
```

## Configuration

You can also pass a path for where you'd like the database to be stored in your file system.

```typescript
new FileStore('/path/to/db');
```
npm package: @slack-wrench/jest-bolt-receiver
Description: Slack api fixtures for testing
Latest version: 3.0.0

# Jest Bolt Receiver

A [receiver](https://slack.dev/bolt/concepts#receiver) built for testing Slack Bolt apps with Jest. This receiver allows you to easily send mock events to your app allowing you to write tests that prove your listeners interact with bolt correctly, instead of only being able to test your listeners in isolation.

## Table of Contents

- [Install](#install)
- [Usage](#usage)
  - [Sending Events](#sending-events)

## Install

```bash
yarn add --dev @slack-wrench/jest-bolt-receiver
# or
npm install --save-dev @slack-wrench/jest-bolt-receiver
```

## Usage

```typescript
import { slashCommand } from '@slack-wrench/fixtures';
import JestReceiver from '@slack-wrench/jest-bolt-receiver';
import {
  MockedWebClient,
  MockWebClient,
} from '@slack-wrench/jest-mock-web-client';
import delay from 'delay';

// Import your app that creates a Slack Bolt App.
import MyApp from './app';

describe('My Awesome App', () => {
  let receiver: JestReceiver;
  let app: MyApp;
  let client: MockWebClient; // Using a mock slack client so we can spy on it

  beforeEach(() => {
    // Pass in this receiver instead of yours or the default express one
    receiver = new JestReceiver();
    app = new MyApp({ receiver });
    client = MockedWebClient.mock.instances[0];
  });

  it('Can handle a slash command', async () => {
    const message = '@slack-wrench makes testing easy!';
    receiver.send(slashCommand('/echo', { text: message }));
    await delay(0); // Wait for anything async.

    // Test what should have happened.
    expect(client.chat.postMessage).toHaveBeenCalledWith(
      expect.objectContaining({
        text: message,
      }),
    );
  });
});
```

### Sending Events

We recommend you use [@slack-wrench/fixtures](../fixtures) to generate and send events. That way, you can easily generate fixtures, set global overrides, and customize payloads. Check its documentation for details.

Send an event to bolt:

```typescript
receiver.send(
  body: Record<string, any>,
)
//: => ReceiverEvent
```
npm package: @slack-wrench/koa-bolt
Description: Run bolt as koa middleware
Latest version: 1.3.0

# Koa Bolt

Use Bolt and Koa together. ⚡️ ❤️ Koa

Koa [middleware](https://koajs.com/#application) that wraps the default Bolt ['ExpressReceiver`](https://github.com/slackapi/bolt/blob/master/src/ExpressReceiver.ts) into a Koa application.

Useful for those who want to use promises in their app middleware and those wanting a little more control over their running application.

## Install

```bash
# Yarn
yarn add @slack-wrench/koa-bolt

# npm
npm install @slack-wrench/koa-bolt
```

## Usage

```typescript
import Koa from 'koa';
import { App, ExpressReceiver } from '@slack/bolt';
import koaBolt from '@slack-wrench/koa-bolt';

const signingSecret = process.env.SLACK_SIGNING_SECRET;
const token = process.env.SLACK_BOT_TOKEN;

const receiver = new ExpressReceiver(signingSecret);
const bolt = new App({ receiver, token });
const app = new Koa();

bolt.command(commandName, fn);

app.use(koaBolt(receiver.app));

app.listen('8080');
console.log('⚡️ Bolt app is running!');
```

## Configuration

You can also pass custom endpoints to `koaBolt` in the same way you do to `Bolt`.

```typescript
const endpoints = {
  events: '/custom/slack/endpoint',
};

const receiver = new ExpressReceiver(signingSecret);
const bolt = new App({ receiver, token, endpoints });
const app = new Koa();

app.use(koaBolt(receiver.app, endpoints));
```