@asteffey/react-fcc-test

1.0.8 • Public • Published

Overview

A React hook to add the freeCodeCamp test suite bundle.

Installation

npm install @asteffey/react-fcc-test or yarn add @asteffey/react-fcc-test

Usage

  • import { useFccTest, FccTests } from '@asteffey/react-fcc-test'
  • useFccTest() will display the FCC test suite.
  • useFccTest({fccTest: 'random-quote-machine'}) will select the specified test from the test suite's dropdown list. FccTests contains an enumeration of all acceptable tests (e.g., FccTests.random_quote_machine, FccTests.bar_chart).
  • useFccTest({queryParam: 'some-parameter'}) will only display the FCC test suite if the specified parameter is present in the URL query string.

Example

import React from 'react';
import { useFccTest, FccTests } from '@asteffey/react-fcc-test';

const App = () => {
    useFccTest({
        fccTest: FccTests.random_quote_machine,
        queryParam: 'fcc-test'
    });

    return (
        <main>
            ...
        </main>
    );
};

export default App;

Readme

Keywords

Package Sidebar

Install

npm i @asteffey/react-fcc-test

Weekly Downloads

1

Version

1.0.8

License

MIT

Unpacked Size

8.9 kB

Total Files

9

Last publish

Collaborators

  • asteffey