<commit_before># Fructose

Fructose is a library to enable functional testing of React Native components in a device or simulator. It allows you to create functional tests against React Native components in isolation. This is different to an end to end testing approach where you test a built application.

Fructose uses [detox] under the hood as the driver for ios devices.

Fructose can technically support both Android and iOS. At the moment it is limited by [detox] to iOS. Once [detox] has Android support, so will fructose.

---

## Overview

Fructose has 2 main parts to it. 
  - Fructose App
  - Fructose Test Utils

You need to use both to create and run a fructose test.

The App component is a React component that sits within an index.ios.js/index.android.js and forms the basis for your test application. It uses a websocket to listen for commands to load in a new component.

The Test Utils enable tests to load components inside the app, and they also enable interaction with the app through [detox].

## Getting Started

### Install

```
yarn add fructose-app --dev
yarn add fructose-test-utils --dev
```

### Set up the app

Create a folder `.fructose` in your project root directory.

Add an `index.ios.js` in this folder with the following content:

```<commit_msg>add some details about detox in the readme<commit_after># Fructose

Fructose is a library to enable functional testing of React Native components in a device or simulator. It allows you to create functional tests against React Native components in isolation. This is different to an end to end testing approach where you test a built application.

Fructose uses [detox] under the hood as the driver for ios devices.

Fructose can technically support both Android and iOS. At the moment it is limited by [detox] to iOS. Once [detox] has Android support, so will fructose.

---

## Overview

Fructose has 2 main parts to it. 
  - Fructose App
  - Fructose Test Utils

You need to use both to create and run a fructose test.

The App component is a React component that sits within an index.ios.js/index.android.js and forms the basis for your test application. It uses a websocket to listen for commands to load in a new component.

The Test Utils enable tests to load components inside the app, and they also enable interaction with the app through [detox].

## Getting Started

### Install

```
yarn add fructose-app --dev
yarn add fructose-test-utils --dev
yarn add react-native-fructose-loader --dev
```

### Set up the app

Create a folder `.fructose` in your project root directory.

Add an `index.ios.js` in this folder with the following content:

```
{'fraction_non_alphanumeric': 0.05566073457023855, 'fraction_numerical': 0.0007572889057175312, 'mean_word_length': 3.865561694290976, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6283735', 'n_tokens_mistral': 723, 'n_tokens_neox': 682, 'n_words': 411}