ryanplasma/peridot-emoji-reporter

An emoji reporter for the Peridot testing framework

v1.1.0 2017-04-30 23:44 UTC

This package is not auto-updated.

Last update: 2024-04-23 22:39:00 UTC


README

Derived from Peridot Dot Reporter

Peridot emoji reporter

Requirements:

  • PHP 7+
  • Terminal that supports emojis - i.e. iTerm2

Usage

I recommend installing the reporter to your project via composer:

$ composer require --dev ryanplasma/peridot-emoji-reporter:~1.0

You can register the reporter via your peridot.php file.

<?php

use Evenement\EventEmitterInterface;
use Peridot\Reporter\Emoji\EmojiReporter;
use Peridot\Reporter\Emoji\EmojiReporterPlugin;
use Spatie\Emoji\Emoji;

return function(EventEmitterInterface $emitter) {
    (new EmojiReporterPlugin($emitter))->register();

    $emitter->on('emoji.start', function (EmojiReporter $reporter) {
        // The next 3 lines are optional - use them to change the default emojis
        $reporter->setPassEmoji(Emoji::smilingCatFaceWithHeartShapedEyes());
        $reporter->setFailEmoji(Emoji::noEntry());
        $reporter->setPendingEmoji(Emoji::alienMonster());
    });
};

Default Emojis are:

  • 🍕 for passing tests
  • 💩 for failing tests
  • 🙉 for pending tests

See above example for how to customize what emojis are used.

Running reporter tests

You can run the reporter specs and also preview the reporter in action like so:

$ vendor/bin/peridot specs/ -r emoji