Coder Social home page Coder Social logo

asynit's People

Contributors

damienalexandre avatar joelwurtz avatar korbeil avatar lyrixx avatar mykiwi avatar pborreli avatar peter279k avatar pyrech avatar samnela avatar tlenclos avatar welcomattic avatar xavierlacot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

asynit's Issues

Add a way to run only one test file

Right now:

php bin/asynit src/OrganizationRoleAdminTest.php 

                                                                     
  [InvalidArgumentException]                                         
  The "src/OrganizationRoleAdminTest.php" directory does not exist.  
                                                                     

Fatal error if amp could not connect to target

If you write:

public function testFoobar()
{
    $response = yield $this->get('http://something-is-not-reachable');
}

you get this:

โœ• Argument 1 passed to Asynit\HttpClient\PromiseAdapter::reject() must be an instance of Http\Client\Exception, instance of Amp\Socket\ConnectException given, called in /PROJECT/tests/vendor/jolicode/asynit/src/HttpClient/PromiseAdapter.php on line 35
PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Asynit\HttpClient\PromiseAdapter::reject() must be an instance of Http\Client\Exception, instance of Amp\Socket\ConnectException given, called in /PROJECT/tests/vendor/jolicode/asynit/src/HttpClient/PromiseAdapter.php on line 35 and defined in /PROJECT/tests/vendor/jolicode/asynit/src/HttpClient/PromiseAdapter.php:92
Stack trace:
#0 /PROJECT/tests/vendor/jolicode/asynit/src/HttpClient/PromiseAdapter.php(35): Asynit\HttpClient\PromiseAdapter->reject(Object(Amp\Socket\ConnectException))
#1 /PROJECT/tests/vendor/amphp/amp/lib/Internal/ResolutionQueue.php(51): Asynit\HttpClient\PromiseAdapter->Asynit\HttpClient\{closure}(Object(Amp\Socket\ConnectException), NULL)
#2 /PROJECT/tests/vendor/amphp/amp/lib/Failure.php(26): Amp\Internal\ResolutionQueue->__invoke(Object(Amp\Socket\ConnectException), NULL)
#3 /PROJECT/tests/vendor/amphp/amp/lib/Internal/Placeholder.php(118): Amp\Failure->onResolve(Object(Amp\Internal\ResolutionQueue))
#4 /PROJECT in /PROJECT/tests/vendor/jolicode/asynit/src/HttpClient/PromiseAdapter.php on line 92

TODO

Accept all method as a dependency even if it's not a test

My test suite has became big (23 files, 3500 LOC) and I would like to refactor it a bit.
All my tests extends a WebTestCase class.
I would like to put some shortcut / helper in it, but ATM it's not possible because the callback in @Depend should be a test. (For recall, a test is a callback that start with the test keywork)

IMHO, It could be any valid callback.

You could argue I can easily transform my callback to a test, but in this case asynit will run the same test each time a class extends WebTestCase. It's a waste of resource.

Do you think we could allow any callback in @Depend?

[RFC] Switch to Amp/Artax Client

Goal of this change would be to allow a better API for writing test, instead of writing

$this->get('http://test.com')->shouldResolve(function ($response) {
     // Write test here
});

It would be written as

$response = yield $this->get('http://test.com');
// Write test here

WDYT ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.