-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from dabapps/scoping
Scoping
- Loading branch information
Showing
7 changed files
with
81 additions
and
117 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
sudo: false | ||
|
||
language: node_js | ||
|
||
install: | ||
- npm install | ||
|
||
script: | ||
- npm test | ||
- npm run dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,10 @@ | |
|
||
**A shallow renderer for React components** | ||
|
||
[![CircleCI](https://circleci.com/gh/JakeSidSmith/react-shallow-renderer.svg?style=svg)](https://circleci.com/gh/JakeSidSmith/react-shallow-renderer) | ||
|
||
## About | ||
|
||
This is a fork of [@jakesidsmith/react-shallow-renderer](https://github.com/jakesidsmith/react-shallow-renderer). | ||
|
||
This is an alternative renderer to `react-test-renderer/shallow` with full support for: | ||
|
||
* React.memo | ||
|
@@ -18,16 +18,10 @@ This is an alternative renderer to `react-test-renderer/shallow` with full suppo | |
|
||
The output of this renderer is far more informative than other existing renderers, providing context of memo wrapped components, fragments, etc. | ||
|
||
If you're using jest you may enjoy [jest-matcher-react-shallow-snapshot](https://www.npmjs.com/package/@jakesidsmith/jest-matcher-react-shallow-snapshot), which wraps this library for ease of use: | ||
|
||
```jsx | ||
expect(<MyComponent />).toMatchReactShallowSnapshot() | ||
``` | ||
|
||
## Install | ||
|
||
```shell | ||
npm i @jakesidsmith/react-shallow-renderer -S | ||
npm i @dabapps/react-shallow-renderer -S | ||
``` | ||
|
||
## Usage | ||
|
@@ -36,7 +30,7 @@ Example with jest: | |
|
||
```jsx | ||
import React from 'react'; | ||
import { ReactShallowRenderer } from '@jakesidsmith/react-shallow-renderer'; | ||
import { ReactShallowRenderer } from '@dabapps/react-shallow-renderer'; | ||
import MyComponent from './path'; | ||
|
||
describe('MyComponent', () => { | ||
|
@@ -181,3 +175,18 @@ const MyComponent = () => <div />; | |
export default connect(mapStateToProps)(React.memo(MyComponent)); | ||
``` | ||
|
||
## Updating this fork from upstream | ||
|
||
Ensure you have added a remote upstream in git e.g. | ||
|
||
```shell | ||
git remote add upstream [email protected]:JakeSidSmith/react-shallow-renderer.git | ||
``` | ||
|
||
Create a new branch (from master) and run the following to pull changes from [upstream](https://github.com/jakesidsmith/react-shallow-renderer): | ||
|
||
```shell | ||
git fetch upstream | ||
git pull upstream master | ||
``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,5 @@ | ||
{ | ||
"extends": [ | ||
"tslint:recommended", | ||
"tslint-eslint-rules", | ||
"tslint-react", | ||
"tslint-config-prettier" | ||
], | ||
"rules": { | ||
"variable-name": [true, "allow-leading-underscore", "ban-keywords"], | ||
"strict-type-predicates": true, | ||
|
||
"object-literal-sort-keys": false, | ||
"interface-name": false, | ||
|
||
"triple-equals": true, | ||
"no-constant-condition": true, | ||
"no-console": true, | ||
"no-debugger": true, | ||
"no-extra-boolean-cast": true, | ||
"no-eval": true, | ||
"no-shadowed-variable": true, | ||
|
||
"radix": true, | ||
"curly": true, | ||
"no-switch-case-fall-through": true, | ||
"switch-default": true, | ||
|
||
"no-var-keyword": true, | ||
"no-unused-expression": true, | ||
"no-use-before-declare": true, | ||
|
||
"jsx-boolean-value": [true, "never"], | ||
"jsx-key": true, | ||
"jsx-no-string-ref": true, | ||
"jsx-self-close": true, | ||
"jsx-no-bind": true, | ||
"jsx-no-lambda": true | ||
} | ||
"tslint-config-dabapps" | ||
] | ||
} |