ryanplasma / peridot-emoji-reporter

Display your peridot test result with emoji!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Peridot Emoji Reporter Build Status codecov

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

About

Display your peridot test result with emoji!

License:MIT License


Languages

Language:PHP 100.0%