Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/martiigarcia/gesdeportiva/llms.txt

Use this file to discover all available pages before exploring further.

gesDeportiva uses Jest for unit and component testing, with react-test-renderer to render React Native components in a pure JavaScript environment — no simulator or emulator required. ESLint with the @react-native-community shared config enforces consistent code style across the project.

Jest configuration

The Jest preset is declared directly in package.json:
package.json
{
  "jest": {
    "preset": "react-native"
  }
}
The react-native preset configures the transform pipeline, module name mapper, and test environment so that React Native components can be tested without a native runtime. Babel transforms are handled by babel-jest using the Metro preset:
babel.config.js
module.exports = {
  presets: ['module:metro-react-native-babel-preset'],
};
The relevant test dependencies from package.json:
PackageVersionPurpose
jest^26.6.3Test runner
babel-jest^26.6.3Babel transform for Jest
react-test-renderer18.0.0Renders React Native components to JSON
react-test-renderer must be the same version as react (18.0.0). A version mismatch will cause tests to fail with a peer dependency warning.

Running tests

npm test
Use --watch during development to re-run only the tests affected by your changes. Use --watchAll to re-run the full suite on every save.

Test files

Tests live in the __tests__/ directory. The project currently includes one test file:
__tests__/
└── App-test.js

App-test.js

This smoke test verifies that the root App component renders without throwing:
__tests__/App-test.js
/**
 * @format
 */

import 'react-native';
import React from 'react';
import App from '../App';

// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';

it('renders correctly', () => {
  renderer.create(<App />);
});
The import 'react-native' line at the top is required by react-test-renderer — it must be imported before the renderer. The test creates a full render of <App /> using renderer.create(). If the component throws during render, the test fails.

Linting with ESLint

gesDeportiva uses ESLint with the @react-native-community shared configuration, which enforces React Native best practices and code style:
.eslintrc.js
module.exports = {
  root: true,
  extends: '@react-native-community',
};
Run the linter across the entire project:
npm run lint
This runs eslint ., which checks all JavaScript and JSX files in the project root according to the rules defined in @react-native-community/eslint-config.
The root: true setting prevents ESLint from looking for configuration files in parent directories, ensuring only this project’s config applies.

Test and lint commands reference

npm test

Build docs developers (and LLMs) love