Skip to content

Latest commit

 

History

History
98 lines (65 loc) · 1.65 KB

CONTRIBUTING.md

File metadata and controls

98 lines (65 loc) · 1.65 KB

Contributing to @axa-fr/react-oidc

First, ensure you have the latest npm.

To get started with the repository:

git clone https://github.com/AxaGuilDEv/react-oidc.git
cd react-oidc
npm install
npm run bootstrap

Commands

How to run examples

Demo of how the component is used.

# Demo using redux as state management
$ npm run example:redux

# Demo using new react context as state management
$ npm run example:context

# Demo in pure vanilla js
$ npm run example:vanilla

How to develop on package

To link your developments with the examples

In an other command window :

$ npm run dev:js

Run Unit Tests

$ npm test

# watch for changes
$ npm test -- --watch

# For a specific file (e.g., in packages/context/__tests__/command.test.js)
$ npm test -- --watch packages/context

By default, npm test also runs the linter. You can skip this by calling jest directly:

$ npx jest
$ npx jest --watch
$ npx jest --config jest.config.js
# etc

Linting

$ npm run lint

It's also a good idea to hook up your editor to an eslint plugin.

To fix lint errors from the command line:

$ npm run lint -- --fix

Coverage

If you would like to check test coverage, run the coverage script, then open coverage/lcov-report/index.html in your favorite browser.

$ npm test -- --coverage

# OS X
$ open coverage/lcov-report/index.html

# Linux
$ xdg-open coverage/lcov-report/index.html

Pull Request

Please respect the following PULL_REQUEST_TEMPLATE.md

Issue

Please respect the following ISSUE_TEMPLATE.md