<commit_before>Feature: Detecting and reporting errors

    Scenario: A crash in the main process
        Given I launch an app
        When I click "main-process-crash"
        Then the app crashed

    Scenario Outline: An unhandled promise rejection in the main process
        Given I launch an app with configuration:
            | bugsnag | <config> |
        When I click "main-process-unhandled-promise-rejection"
        Then the total requests received by the server matches:
            | events  | 1        |
        Then the headers of every event request contains:
            | Bugsnag-API-Key   | <KEY> |
            | Content-Type      | application/json                 |
            | Bugsnag-Integrity | {BODY_SHA1}                      |
        Then the contents of an event request matches "main/unhandled-rejection/<config>.json"

        Examples:
            | config          |
            | default         |
            | complex-config  |

    Scenario Outline: An uncaught exception in the main process
        Given I launch an app with configuration:
            | bugsnag | <config> |
        When I click "main-process-uncaught-exception"
        Then the total requests received by the server matches:
            | events  | 1        |
        Then the headers of every event request contains:
            | Bugsnag-API-Key   | <KEY> |
            | Content-Type      | application/json                 |
            | Bugsnag-Integrity | {BODY_SHA1}                      |
        Then the contents of an event request matches "main/uncaught-exception/<config>.json"

        Examples:
            | config          |
            | default         |
            | complex-config  |

    Scenario Outline: An event occurs when reporting is disabled
        Given I launch an app with configuration:
            | bugsnag | <config> |
        When I click "<link>"
        Then the total requests received by the server matches:
            | events  | 0        |

        Examples:
            | config                       | link                                     |
            | disable-uncaught-exceptions  | main-process-uncaught-exception          |
            | disable-unhandled-rejections | main-process-unhandled-promise-rejection |

    Scenario: An uncaught exception in the renderer
        Given I launch an app
        When I click "renderer-uncaught-exception"

    Scenario: An unhandled promise rejection in the renderer
        Given I launch an app
        When I click "renderer-unhandled-promise-rejection"<commit_msg>Add session counts to error-handling.feature<commit_after>Feature: Detecting and reporting errors

    Scenario: A crash in the main process
        Given I launch an app
        When I click "main-process-crash"
        Then the app crashed
        And the total requests received by the server matches:
            | events   | 0        |
            | sessions | 1        |

    Scenario Outline: An unhandled promise rejection in the main process
        Given I launch an app with configuration:
            | bugsnag | <config> |
        When I click "main-process-unhandled-promise-rejection"
        Then the total requests received by the server matches:
            | events   | 1        |
            | sessions | 1        |
        Then the headers of every event request contains:
            | Bugsnag-API-Key   | <KEY> |
            | Content-Type      | application/json                 |
            | Bugsnag-Integrity | {BODY_SHA1}                      |
        Then the contents of an event request matches "main/unhandled-rejection/<config>.json"

        Examples:
            | config          |
            | default         |
            | complex-config  |

    Scenario Outline: An uncaught exception in the main process
        Given I launch an app with configuration:
            | bugsnag | <config> |
        When I click "main-process-uncaught-exception"
        Then the total requests received by the server matches:
            | events   | 1        |
            | sessions | 1        |
        Then the headers of every event request contains:
            | Bugsnag-API-Key   | <KEY> |
            | Content-Type      | application/json                 |
            | Bugsnag-Integrity | {BODY_SHA1}                      |
        Then the contents of an event request matches "main/uncaught-exception/<config>.json"

        Examples:
            | config          |
            | default         |
            | complex-config  |

    Scenario Outline: An event occurs when reporting is disabled
        Given I launch an app with configuration:
            | bugsnag | <config> |
        When I click "<link>"
        Then the total requests received by the server matches:
            | events   | 0        |
            | sessions | 1        |

        Examples:
            | config                       | link                                     |
            | disable-uncaught-exceptions  | main-process-uncaught-exception          |
            | disable-unhandled-rejections | main-process-unhandled-promise-rejection |

    Scenario: An uncaught exception in the renderer
        Given I launch an app
        When I click "renderer-uncaught-exception"
        Then the total requests received by the server matches:
            | events   | 0        |
            | sessions | 1        |

    Scenario: An unhandled promise rejection in the renderer
        Given I launch an app
        When I click "renderer-unhandled-promise-rejection"
        Then the total requests received by the server matches:
            | events   | 0        |
            | sessions | 1        |
{'fraction_non_alphanumeric': 0.06130670870555264, 'fraction_numerical': 0.003328078472587143, 'mean_word_length': 1.4901875272568688, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '232547', 'n_tokens_mistral': 1402, 'n_tokens_neox': 1355, 'n_words': 486}