-
Notifications
You must be signed in to change notification settings - Fork 0
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
8 changed files
with
88 additions
and
118 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 @@ | ||
//registry.npmjs.org/:_authToken=${NPM_TOKEN} |
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 jest matcher for shallow rendered React component snapshots** | ||
|
||
[![CircleCI](https://circleci.com/gh/JakeSidSmith/jest-matcher-react-shallow-snapshot.svg?style=svg)](https://circleci.com/gh/JakeSidSmith/jest-matcher-react-shallow-snapshot) | ||
|
||
## About | ||
|
||
This is a fork of [@jakesidsmith/jest-matcher-react-shallow-snapshot](https://github.com/jakesidsmith/jest-matcher-react-shallow-snapshot). | ||
|
||
This is a jest matcher that allows you to easily create shallow snapshots of React components will full support for: | ||
|
||
* React.memo | ||
|
@@ -18,9 +18,9 @@ This is a jest matcher that allows you to easily create shallow snapshots of Rea | |
|
||
The output of this matcher is far more informative than other existing solutions, providing context of memo wrapped components, fragments, etc, and does not require importing a renderer for each of your test files. | ||
|
||
This relies on [react-shallow-renderer](https://www.npmjs.com/package/@jakesidsmith/react-shallow-renderer) under the hood, which you could use without the jest matcher if you prefer / are using another test suite. | ||
This relies on [react-shallow-renderer](https://www.npmjs.com/package/@dabapps/react-shallow-renderer) under the hood, which you could use without the jest matcher if you prefer / are using another test suite. | ||
|
||
Check out the [react-shallow-renderer](https://www.npmjs.com/package/@jakesidsmith/react-shallow-renderer) readme for some examples of the snapshot output. | ||
Check out the [react-shallow-renderer](https://www.npmjs.com/package/@dabapps/react-shallow-renderer) readme for some examples of the snapshot output. | ||
|
||
## Example | ||
|
||
|
@@ -31,7 +31,7 @@ expect(<MyComponent />).toMatchReactShallowSnapshot(); | |
## Install | ||
|
||
```shell | ||
npm i @jakesidsmith/jest-matcher-react-shallow-snapshot -S | ||
npm i @dabapps/jest-matcher-react-shallow-snapshot -S | ||
``` | ||
|
||
## Configuration | ||
|
@@ -53,7 +53,7 @@ module.exports = { | |
If you don't already have a such a file you should create one, and then simply import this library in that file: | ||
|
||
```js | ||
import '@jakesidsmith/jest-matcher-react-shallow-snapshot'; | ||
import '@dabapps/jest-matcher-react-shallow-snapshot'; | ||
``` | ||
|
||
If you are using TypeScript, importing this file from your setup file should apply the types needed to call `.toMatchReactShallowSnapshot`. If it doesn't, then make sure that the setup file is included in your tsconfig. | ||
|
@@ -65,3 +65,18 @@ Now you can simply render a react component and expect it to match your shallow | |
```jsx | ||
expect(<MyComponent />).toMatchReactShallowSnapshot(); | ||
``` | ||
|
||
## Updating this fork from upstream | ||
|
||
Ensure you have added a remote upstream in git e.g. | ||
|
||
```shell | ||
git remote add upstream [email protected]:JakeSidSmith/jest-matcher-react-shallow-snapshot.git | ||
``` | ||
|
||
Create a new branch (from master) and run the following to pull changes from [upstream](https://github.com/jakesidsmith/jest-matcher-react-shallow-snapshot): | ||
|
||
```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" | ||
] | ||
} |