Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joetannenbaum/day
Dusk-like integration testing for your CLI apps
https://github.com/joetannenbaum/day
Last synced: about 1 month ago
JSON representation
Dusk-like integration testing for your CLI apps
- Host: GitHub
- URL: https://github.com/joetannenbaum/day
- Owner: joetannenbaum
- License: mit
- Created: 2024-03-27T10:06:23.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-03-29T13:07:28.000Z (9 months ago)
- Last Synced: 2024-04-03T14:17:35.849Z (9 months ago)
- Language: PHP
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# Day
This package provides Dusk-like integration testing for your terminal commands. Under the hood, it requires the Unix `expect` command in order to function correctly.
> [!WARNING]
> This package is currently in active development. The API is subject to change.> [!NOTE]
> If you're testing Laravel commands this package currently supports only Symfony style commands, it has not been updated for Prompts yet.## Example
The following would run the `bellows launch` command from the `bellows-tester` directory and answer several questions as they appear in the terminal.
```php
use Day\Day;use function Day\command;
command('bellows launch')
->fromDir(__DIR__ . '/../../bellows-tester')
->question('Which server would you like to use', 'bellows-tester')
->question('App Name', 'Bellows Test')
->deny('Enable quick deploy')
->confirm('Launch now')
->waitFor('Launched!', 60)
->exec();
```