npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@salesforce/plugin-flow

v1.0.5

Published

Plugin for testing flows

Downloads

814

Readme

Salesforce Flow Test Plugin

npm (scoped) License Commitizen friendly

Introduction

This is an oclif plugin that supports the Salesforce Flow Test commands.

Building the Plugin

Clone the project and cd into it:

$ git clone [email protected]:salesforcecli/plugin-flow.git
$ cd plugin-flow

Ensure you have Yarn installed, then run:

$ yarn install
$ yarn build

Linking the Plugin

Link the plugin from the plugin-flow package directory and then run your command:

$ sf plugins link .
$ sf flow run test -o [email protected]

Alternatively, you can also run the command from the plugin-flow package directory without linking the plugin:

$ bin/dev.js flow run test -o [email protected]

Running the Test Suite

Test the test suite locally by building the project first and then running the tests.

$ yarn build
$ yarn test

Commands

sf flow get test

Display test results for a specific asynchronous test run.

USAGE
  $ sf flow get test -o <value> -i <value> [--json] [--flags-dir <value>] [--api-version <value>]
    [--detailed-coverage -c] [-d <value>] [-r human|tap|junit|json] [--concise]

FLAGS
  -c, --code-coverage           Retrieve code coverage results.
  -d, --output-dir=<value>      Directory in which to store test result files.
  -i, --test-run-id=<value>     (required) ID of the test run.
  -o, --target-org=<value>      (required) Username or alias of the target org. Not required if the `target-org`
                                configuration variable is already set.
  -r, --result-format=<option>  [default: human] Format of the test results.
                                <options: human|tap|junit|json>
      --api-version=<value>     Override the api version used for api requests made by this command
      --concise                 Display only failed test results; works with human-readable output only.
      --detailed-coverage       Not available for flow tests.

GLOBAL FLAGS
  --flags-dir=<value>  Import flag values from a directory.
  --json               Format output as json.

DESCRIPTION
  Display test results for a specific asynchronous test run.

  Provide a flow test run ID to display test results for an enqueued or completed asynchronous test run. The test run ID
  is displayed after running the "sf flow run test" command.

  To see code coverage results, use the --code-coverage flag with --result-format. The output displays a high-level
  summary of the test run and the code coverage values for flow tests in your org. If you specify human-readable result
  format, use the --detailed-coverage flag to see detailed coverage results for each test method run.

EXAMPLES
  Display flow test results for your default org using a test run ID:

    $ sf flow get test --test-run-id <test run id>

  Similar to previous example, but output the result in JUnit format:

    $ sf flow get test --test-run-id <test run id> --result-format junit

  Also retrieve code coverage results and output in JSON format:

    $ sf flow get test --test-run-id <test run id> --code-coverage --json

  Specify a directory in which to save the test results from the org with the “[email protected]” username (rather than your
  default org):

    $ sf flow get test --test-run-id <test run id> --code-coverage --output-dir <path to outputdir> --target-org \
      [email protected]'

See code: src/commands/flow/get/test.ts

sf flow run test

Invoke flow tests in an org.

USAGE
  $ sf flow run test -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-r human|tap|junit|json]
    [--concise] [-d <value>] [-c] [-y] [-l RunLocalTests|RunAllTestsInOrg|RunSpecifiedTests] [-n <value>... | -s
    <value>... | -t <value>...]

FLAGS
  -c, --code-coverage           Retrieve code coverage results.
  -d, --output-dir=<value>      Directory in which to store test result files.
  -l, --test-level=<option>     Level of tests to run; default is RunLocalTests.
                                <options: RunLocalTests|RunAllTestsInOrg|RunSpecifiedTests>
  -n, --class-names=<value>...  Flow names that contain flow tests to run.
  -o, --target-org=<value>      (required) Username or alias of the target org. Not required if the `target-org`
                                configuration variable is already set.
  -r, --result-format=<option>  [default: human] Format of the test results.
                                <options: human|tap|junit|json>
  -s, --suite-names=<value>...  Not available for flow tests.
  -t, --tests=<value>...        Flow test names to run.
  -y, --synchronous             Run flow tests for one flow synchronously; if not specified, tests are run
                                asynchronously.
      --api-version=<value>     Override the api version used for api requests made by this command
      --concise                 Display only failed test results; works with human-readable output only.

GLOBAL FLAGS
  --flags-dir=<value>  Import flag values from a directory.
  --json               Format output as json.

DESCRIPTION
  Invoke flow tests in an org.

  Specify which tests to run by using the --class-names flag followed by the names of the flows you want to test. For
  example, if you save a flow with the name Flow1, then use: --class-names Flow1.

  To see code coverage results, use the --code-coverage flag with --result-format. The output displays a high-level
  summary of the test run and the code coverage values for classes in your org. If you specify human-readable result
  format, use the --detailed-coverage flag to see detailed coverage results for each test method run.

  By default, "flow run test" runs asynchronously and immediately returns a test run ID. If you use the -–synchronous
  flag, you can use the --wait flag to specify the number of minutes to wait; if the tests finish in that timeframe, the
  command displays the results. If the tests haven't finished by the end of the wait time, the command displays a test
  run ID. Use the "flow get test --test-run-id" command to get the results.

  To run both Flow and Apex tests together, run the "sf logic run test" CLI command, which has similar flags as this
  command, but expands the --tests flag to also include Apex tests.

  You must have the "View All Data" org system permission to use this command. The permission is disabled by default and
  can be enabled only by a system administrator.

EXAMPLES
  Run all local tests in your default org:

    $ sf flow run test --test-level RunLocalTests

  Run all the Flow1 and Flow2 flow tests in the org with alias “scratchOrg”:

    $ sf flow run test --target-org scratchOrg --class-names Flow1 --class-names Flow2

  Run specific Flow1 and Flow2 flow tests in your default org:

    $ sf flow run test --tests Flow1.Test1 --tests Flow2.Test2 --test-level RunSpecifiedTests

  Run all tests synchronously in your default org; the command waits to display the test results until all tests
  finish:

    $ sf flow run test –synchronous

  Run all local tests in the org with the username “[email protected]”; save the output to the specified directory:

    $ sf flow run test --test-level RunLocalTests --output-dir /Users/susan/temp/cliOutput --target-org [email protected]

FLAG DESCRIPTIONS
  -l, --test-level=RunLocalTests|RunAllTestsInOrg|RunSpecifiedTests  Level of tests to run; default is RunLocalTests.

    Here's what the levels mean:

    - RunLocalTests — All tests in your org are run, except the ones that originate from installed managed and unlocked
    packages.
    - RunAllTestsInOrg — All tests are run. The tests include all tests in your org, including tests of managed
    packages.
    - RunSpecifiedTests - Only the tests that you specify with the --tests flag are run.

  -n, --class-names=<value>...  Flow names that contain flow tests to run.

    Default is all flow tests. If you select --class-names, you can't specify --tests.

  -s, --suite-names=<value>...  Not available for flow tests.

    Not available for flow tests.

  -t, --tests=<value>...  Flow test names to run.

    Default is all flow tests. If you specify --tests, you can't specify --class-names.

See code: src/commands/flow/run/test.ts