{"id":49528735,"url":"https://github.com/salesforcecli/source-testkit","last_synced_at":"2026-06-06T06:00:41.992Z","repository":{"id":38053998,"uuid":"367378452","full_name":"salesforcecli/source-testkit","owner":"salesforcecli","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-23T04:03:14.000Z","size":3598,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-05-23T06:14:24.223Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/salesforcecli.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-05-14T13:55:15.000Z","updated_at":"2026-05-23T04:01:05.000Z","dependencies_parsed_at":"2024-01-13T09:24:13.467Z","dependency_job_id":"22d3b78e-4533-4dd5-aa7c-81f0d93591cd","html_url":"https://github.com/salesforcecli/source-testkit","commit_stats":{"total_commits":365,"total_committers":14,"mean_commits":"26.071428571428573","dds":0.4794520547945206,"last_synced_commit":"4a2aa8fcaba50eeb6c641ebd5f984946b8db994a"},"previous_names":[],"tags_count":430,"template":false,"template_full_name":null,"purl":"pkg:github/salesforcecli/source-testkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salesforcecli%2Fsource-testkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salesforcecli%2Fsource-testkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salesforcecli%2Fsource-testkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salesforcecli%2Fsource-testkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/salesforcecli","download_url":"https://codeload.github.com/salesforcecli/source-testkit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salesforcecli%2Fsource-testkit/sbom","scorecard":{"id":796401,"data":{"date":"2025-08-11","repo":{"name":"github.com/salesforcecli/source-testkit","commit":"95d9b95777cd6f4ceb02ee74ec1b815ab71cc8d0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.9,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/15 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":10,"reason":"30 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Security-Policy","score":9,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Warn: One or no descriptive hints of disclosure, vulnerability, and/or timelines in security policy","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/automerge.yml:1","Warn: no topLevel permission defined: .github/workflows/create-github-release.yml:1","Warn: no topLevel permission defined: .github/workflows/devScripts.yml:1","Warn: no topLevel permission defined: .github/workflows/failureNotifications.yml:1","Warn: no topLevel permission defined: .github/workflows/notify-slack-on-pr-open.yml:1","Warn: no topLevel permission defined: .github/workflows/onRelease.yml:1","Warn: no topLevel permission defined: .github/workflows/test.yml:1","Warn: no topLevel permission defined: .github/workflows/validate-pr.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/automerge.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/salesforcecli/source-testkit/automerge.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/create-github-release.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/salesforcecli/source-testkit/create-github-release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/devScripts.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/salesforcecli/source-testkit/devScripts.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/failureNotifications.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/salesforcecli/source-testkit/failureNotifications.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/notify-slack-on-pr-open.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/salesforcecli/source-testkit/notify-slack-on-pr-open.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/onRelease.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/salesforcecli/source-testkit/onRelease.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/onRelease.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/salesforcecli/source-testkit/onRelease.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/onRelease.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/salesforcecli/source-testkit/onRelease.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/salesforcecli/source-testkit/test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/salesforcecli/source-testkit/test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/salesforcecli/source-testkit/test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/validate-pr.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/salesforcecli/source-testkit/validate-pr.yml/main?enable=pin","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of  11 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 15 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T09:08:21.073Z","repository_id":38053998,"created_at":"2025-08-23T09:08:21.073Z","updated_at":"2025-08-23T09:08:21.073Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33971107,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-06T02:00:07.033Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-02T05:09:27.305Z","updated_at":"2026-06-06T06:00:41.984Z","avatar_url":"https://github.com/salesforcecli.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM](https://img.shields.io/npm/v/@salesforce/source-testkit.svg?label=@salesforce/source-testkit)](https://www.npmjs.com/package/@salesforce/source-testkit) [![Downloads/week](https://img.shields.io/npm/dw/@salesforce/source-testkit.svg)](https://npmjs.org/package/@salesforce/source-testkit) [![License](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](https://opensource.org/license/apache-2-0)\n\n# Description\n\nThe @salesforce/source-testkit library wraps around [@salesforce/cli-plugins-testkit](https://github.com/salesforcecli/cli-plugins-testkit) to provide a simple interface for Salesforce CLI plug-in authors to compose source (e.g. deploy, retrieve, push, and pull) related non-unit-tests (NUTs).\n\nSpecifically, [`SourceTestKit`](src/testkit.ts) provides the following conveniences:\n\n1. Wrapper methods for the `source` CLI commands. For example, the `force:source:deploy` and `force:source:retrieve` commands can be invoked like so:\n   ```typescript\n   const sourceTestkit = await SourceTestkit.create({\n     repository: 'https://github.com/trailheadapps/dreamhouse-lwc.git',\n     nut: __filename,\n   });\n   sourceTestkit.deploy({ args: `--sourcepath force-app` });\n   sourceTestkit.retrieve({ args: `--sourcepath force-app` });\n   ```\n2. [Common assertions](src/assertions.ts) like expecting a file to be deployed or expecting a file to be retrieved. These are all accessible under `sourceTestkit.expect`. For example:\n   ```typescript\n   const sourceTestkit = await SourceTestkit.create({\n     repository: 'https://github.com/trailheadapps/dreamhouse-lwc.git',\n     nut: __filename,\n   });\n   sourceTestkit.deploy({ args: `--sourcepath force-app` });\n   sourceTestkit.expect.filesToBeDeployed('force-app/**/*');\n   ```\n   **NOTE** When providing files paths to these assertion methods, you need to provide a [glob pattern](https://github.com/mrmlnc/fast-glob#pattern-syntax), NOT an OS specific file path. We have chosen this approach because it provides a lot of flexibility when writing tests and because it's OS agnostic.\n\n# Usage\n\nAdd this library as a dev dependencies to your project.\n\n```bash\nyarn add @salesforcecli/source-testkit --dev\n```\n\n# Examples\n\n```typescript\nimport { SourceTestkit } from '@salesforce/source-testkit';\n\ncontext('Deploy from source path NUT', () =\u003e {\n  let sourceTestkit: SourceTestkit;\n\n  before(async () =\u003e {\n    sourceTestkit = await SourceTestkit.create({\n      repository: 'https://github.com/trailheadapps/dreamhouse-lwc.git',\n      nut: __filename,\n    });\n  });\n\n  after(async () =\u003e {\n    await sourceTestkit?.clean();\n  });\n\n  describe('--sourcepath flag', () =\u003e {\n    it(`should deploy force-app`, async () =\u003e {\n      await sourceTestkit.deploy({ args: '--sourcepath force-app' });\n      await sourceTestkit.expect.filesToBeDeployed(['force-app/**/*']);\n    });\n\n    it('should throw an error if the sourcepath is not valid', async () =\u003e {\n      const deploy = await sourceTestkit.deploy({ args: '--sourcepath DOES_NOT_EXIST', exitCode: 1 });\n      sourceTestkit.expect.errorToHaveName(deploy, 'SourcePathInvalid');\n    });\n  });\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalesforcecli%2Fsource-testkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalesforcecli%2Fsource-testkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalesforcecli%2Fsource-testkit/lists"}