You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@balena/jellyfish-test-harness

Package Overview
Dependencies
Maintainers
1
Versions
2774
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@balena/jellyfish-test-harness

Test harness helpers for Jellyfish repos

9.2.12
latest
Source
npmnpm
Version published
Weekly downloads
391
-59.4%
Maintainers
1
Weekly downloads
 
Created
Source

Notice: This utility has been discontinued. Test utilities are now provided by the same modules that provide the functionality. See the test utilities exported by jellyfish-core and jellyfish-worker.

Jellyfish Test Harness

Test harness helpers for Jellyfish repos.

Usage

Below are examples on how to use this library:

Sync integration translate tests

Below is an overview of how to call the scenario runner to execute translate tests. Real world examples can be found in many Jellyfish plugins as well.

import { syncIntegrationScenario } from '@balena/jellyfish-test-harness';
import webhooks from './webhooks/my-integration-name';

syncIntegrationScenario.run(
  {
    test,
    before: beforeAll,
    beforeEach,
    after: afterAll,
    afterEach,
  }, {
    // The directory in which your sync integration test and webhooks directory are located
    basePath: __dirname,

    // Optional additional test hooks
    before: (test) => {},
    beforeEach: (test) => {},
    after: (test) => {},
    afterEach: (test) => {},

    // An optional method to be called to prepare card data before inserting it
    prepareEvent: (event: any) => { return event },

    // Additional options to pass to the webhook scenario runner
    options: {},

    // A list of plugin classes required to run the tests
    plugins: [],

    // A list of card slugs that must be loaded before running any tests
    cards: [ ... ],

    // The scenarios that will be run
    scenarios: webhooks,

    // The URL of the integration
    baseUrl: 'https://<my-integration-endpoint>',

    // The regular expression picking paths on the baseUrl to provide mock responses to
    stubRegex: /.*/,

    // The slug of the integration under test
    source: '<my-integration>',

    // A callback to verify if a request is authorized
    isAuthorized: (request) => {
      ...
    },
  },
);

Documentation

Writing translate tests

Publish Documentation

Visit the website for complete documentation: https://product-os.github.io/jellyfish-test-harness

FAQs

Package last updated on 29 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts