0.1.6 • Published 9 days ago

@gurke/sqs v0.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
9 days ago

@gurke/sqs

A collection of cucumber step definitions to help testing sqs configuration.

Prerequisite

  1. Using Jest as a test runner
  2. Using jest-cucumber library for cucumber setup

Features

Available step definitions:

given(/a (fifo|standard) queue with queue name variable "(.*)" exists/);

given(
  /the following batch of queue messages has been sent to queue with queue name variable "(.*)":/
);

then(/queue with variable name "(.*)" should have "(.*)" (message|messages)/);

then(
  /queue with variable name "(.*)" should have message with the following MessageBody and MessageAttributes/
);

then(
  /queue with variable name "(.*)" should have message with following message Body:/
);

Example usage

import { autoBindSteps, loadFeatures } from 'jest-cucumber';
import {
  sqsSteps,
  sqsCleanUp,
  waitForInFlightMessagesToBeVisible,
} from '@gurke/sqs';

const features = loadFeatures(/* Your feature file(s) */);

const steps = ({ when }) => {
  when(/amazing things happen/, async () => {
    // insert execution of your amazing event(s) / action(s)

    // remember to wait for the message to be visible in the last step of your when scenario
    await waitForInFlightMessagesToBeVisible();
  });
};

afterEach(async () => {
  await sqsCleanUp();
});

autoBindSteps(features, [sqsSteps, steps]);

With this setup, the available step definitions can be use in your feature file.

Default environment variables

The default value of the environment variables for AWS in this library are: |Variable Name|Value| | -------- | ---- | |AWS_REGION|eu-central-1| |TEST_SQS_ENDPOINT|http://eu-central-1.queue.localhost.localstack.cloud:4566| |TEST_AWS_ACCESS_KEY_ID|test| |TEST_AWS_SECRET_ACCESS_KEY|test|

If you need to pass a different value, you can configure it by overwriting it.

0.1.6

9 days ago

0.1.5

7 months ago

0.1.4

7 months ago

0.1.3

7 months ago

0.1.2

7 months ago

0.1.1

7 months ago

0.1.0

9 months ago

1.0.11

10 months ago

1.0.10

10 months ago

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago