Pest: Require to set the "minimum-stability" in composer.json

Created on 25 May 2020  路  5Comments  路  Source: pestphp/pest

Hi :wave:, I have been using pest and reading his documentation. It's useful to have an option to skip a specific test with ->skip() and also to run a single test with ->only().

Nice work!

I have a question, is it required to set the minimum-stability in our composer.json?

Because if not exist the option for "minimum-stability" I can't require pest and I get this error:

$ composer require pestphp/pest --dev

Using version ^0.1.5 for pestphp/pest
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for pestphp/pest ^0.1.5 -> satisfiable by pestphp/pest[v0.1.5].
    - pestphp/pest v0.1.5 requires nunomaduro/collision ^5.0 -> satisfiable by nunomaduro/collision[v5.0.0-BETA1] but these conflict with your requirements or minimum-stability.


Installation failed, reverting ./composer.json to its original content.

Now, if I add the minimum-stability in composer.json like this:

{
    "name": "a/b",
    "minimum-stability": "dev",
    "require": {},
    "require-dev": {
        "phpunit/phpunit": "^9.0"
    }
}

Then pest it's installed ok and I can use ./vendor/bin/pest

Most helpful comment

We need to add a note on the installation process that people need to have this in their composer:

"minimum-stability": "dev",
"prefer-stable": true,

Can someone pull request this please?

All 5 comments

It's usually set in frameworks like Laravel and packages with the additional prefer-stable option set. (e.g. https://github.com/laravel/laravel/blob/master/composer.json#L49-L50)

When Collision v5 releases as a stable release this isn't technically needed, however I usually include it anyway. Not sure what other people do. 馃

We need to add a note on the installation process that people need to have this in their composer:

"minimum-stability": "dev",
"prefer-stable": true,

Can someone pull request this please?

will be fixed with pestphp/website#22

Thank you very much

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gulien picture gulien  路  3Comments

AlexMartinFR picture AlexMartinFR  路  6Comments

maks-rafalko picture maks-rafalko  路  6Comments

m1guelpf picture m1guelpf  路  6Comments

beliolfa picture beliolfa  路  3Comments