https://github.com/currents-dev/cli
https://github.com/currents-dev/cli
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/currents-dev/cli
- Owner: currents-dev
- Created: 2021-05-08T05:12:13.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-11-25T09:10:07.000Z (about 1 year ago)
- Last Synced: 2024-11-30T14:45:15.864Z (about 1 year ago)
- Language: TypeScript
- Size: 1.5 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# @currents/cli
Integrate Cypress with Currents - a drop-in replacement for Cypress Cloud
Currents | Changelog | Compatibility |
Documentation
---
**Dec 2023 Update**
If you are seeing `Error: certificate has expired`, please upgrade to version 4.0.4+.
**March 2023 Update**
⭐️ Cypress 12.6.0+ users, please use https://github.com/currents-dev/cypress-cloud if you are seeing `Cypress does not support recording test results to this third party service` error ⭐️
---
## CLI Usage
Use Currents as an orchestration and recording service. The command passes down all the CLI flags to cypress and executes cypress behind the scenes.
```sh
npm install @currents/cli cypress
npx currents run --parallel --record --key XXXXXX --ci-build-id build-001
```
## API
### `run`
Run Cypress via its [Module API](https://docs.cypress.io/guides/guides/module-api)
```ts
run(config: CypressCommandLine.CypressRunOptions): Promise
```
Example:
```ts
import { run } from "@currents/cli";
const cypressOptions: Partial = {
browser: "chrome",
parallel: true,
record: true,
key: "Currents key from https://app.currents.dev",
tag: "smoke",
};
const results = await run(cypressOptions);
```
### `spawn`
Spawn Cypress as a child process and inherit all the flags and environment variables. It invokes `process.exit` with the child process' exit code at the end of its execution.
```ts
spawn(): Promise
```
Example:
```ts
import { spawn } from "@currents/cli";
await spawn();
```
## Breaking Changes
### Version 4+
Version 4+ doesn't modify the local installation of Cypress. The following complimentary binaries were deprecated:
- `currents-prepare` script is deprecated. Use `run` or `spawn` API instead.
- `currents-reset` script is deprecated, use `run` or `spawn` API instead.
- `patch` API is deprecated. Use `run` or `spawn` instead.