0.1.15 â€ĸ Published 1 year ago

react-development-test-component v0.1.15

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

React Test Development Tool 🚀

This React development tool provides a convenient interface for running and monitoring test cases. It allows you to execute individual test functions, run all tests multiple times, and focus on failed tests for debugging purposes.

Prerequisites đŸ› ī¸

Before using this library, ensure that you have the following dependencies installed:

  • Node.js - Node.js runtime environment.
  • npm or Yarn - Package managers for installing and managing dependencies.

Installation đŸ› ī¸

To use this library in your React project, follow these steps:

  1. Install the package using npm or yarn:

    npm i react-development-test-component
    yarn add react-development-test-component
  2. Import the necessary components into your project:

    import DevelopmentTool from 'react-development-test-component';

Usage â„šī¸

DevelopmentTool Component

The DevelopmentTool component renders a user-friendly interface for running tests and handling login credentials (if required). It accepts the following props:

  • testFunctions: An array of functions representing test cases.
  • loginFetch: The function to handle login form submission.

Example usage:

import React from 'react';
import DevelopmentTool from 'react-development-test-component';

const MyComponent = () => {
  // Define test functions
  const testFunctions = [
    // Define your test functions here
  ];

  // Function to handle login form submission
  const handleLoginFetch = (username, password) => {
    // Implement your login logic here
  };

  return (
    <DevelopmentTool testFunctions={testFunctions} loginFetch={handleLoginFetch} />
  );
};

export default MyComponent;

TestRunnerComponent

The TestRunnerComponent is an internal component used by the DevelopmentTool for executing and displaying test results. It can also be used independently if needed. It accepts the following props:

  • testFunctions: An array of functions representing test cases.

Example usage:

import React from 'react';
import TestRunnerComponent from 'react-development-test-component';

const MyTestRunner = () => {
  // Define test functions
  const testFunctions = [
    // Define your test functions here
  ];

  return (
    <TestRunnerComponent testFunctions={testFunctions} />
  );
};

export default MyTestRunner;

Features 🌟

  • Run All Tests: Execute all test functions a specified number of times.
  • Run Only Failed Tests: Run only the tests that have failed in previous executions.
  • Test Results: View detailed test results, including test names, states (correct or incorrect), and messages.

Contributing 🤝

Contributions are welcome! If you encounter any issues or have suggestions for improvement, please open an issue on the GitHub repository.

License 📝

This project is licensed under the MIT License - see the LICENSE file for details.

0.1.15

1 year ago

0.1.14

1 year ago

0.1.13

1 year ago

0.1.12

1 year ago

0.1.11

1 year ago

0.1.10

1 year ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago