Merge remote-tracking branch 'origin/master' into release/3.3

# Conflicts:
#	addons/comments/package.json
#	addons/knobs/package.json
#	addons/storyshots/src/index.js
#	yarn.lock
This commit is contained in:
hypnos 2017-11-03 22:33:56 +03:00
commit bb97feaa33
6 changed files with 55 additions and 36 deletions

View File

@ -116,6 +116,58 @@ If you follow that process, you can then link to the github repository in the is
**NOTE**: If your issue involves a webpack config, create-react-app will prevent you from modifying the _app's_ webpack config, however you can still modify storybook's to mirror your app's version of storybook. Alternatively, use `yarn eject` in the CRA app to get a modifiable webpack config.
### Executing Tests Locally
Tests can be executed locally with the `yarn test` command, which gives you CLI options to execute various test suites in different modes. Some of the test suites have special set-up needs, which are listed below.
The execution modes available can be selected from the cli or passed to `yarn test` with specific parameters. Available modes include `--watch`, `--coverage`, and `--runInBand`, which will respectively run tests in watch mode, output code coverage, and run selected test suites serially in the current process.
#### Core & React & Vue Tests
`yarn test --core`
This option executes test from `<rootdir>/app/react`, `<rootdir>/app/vue`, and `<rootdir>/lib`
Before the tests are ran, the project must be bootstrapped with core. You can accomplish this with `yarn bootstrap --core`
#### React-Native example Tests
`yarn test --reactnative`
This option executes tests from `<rootdir>/app/react-native`
Before these tests are ran, the project must be bootstrapped with the React Native example enabled. You can accomplish this by running `yarn bootstrap --reactnative`
#### Integration Tests (Screenshots of running apps)
`yarn test --integration`
This option executes tests from `<rootdir>/integration`
In order for the snapshot-integration tests to be executed properly, examples being tested must be running on their defaults ports, as declared in `integration/examples.test.js`
Puppeteer is used to launch and grab screenshots of example pages, while jest is used to assert matching images.
### Updating Tests
Before any contributes are submitted in a PR, make sure to add or update meaningful tests. A PR that has failing tests will be regarded as a “Work in Progress” and will not be merged until all tests pass.
When creating new unit test files, the tests should adhere to a particular folder structure and naming convention, as defined below.
```sh
#Proper naming convention and structure for js tests files
+-- parentFolder
| +-- [filename].js
| +-- [filename].test.js
```
#### Updating Integration Screenshots
Integration screenshots can be updated using pupeteer's screenshot command. For example:
```
# Take an updated screenshot of http://localhost:9010 and save over existing
await page.goto('http://localhost:9010');
page.screenshot({path: '__image_snapshots__/cra-kitchen-sink-snap.png'});
```
## Pull Requests (PRs)
We welcome your contributions. There are many ways you can help us. This is few of those ways:
@ -147,11 +199,11 @@ Once you've helped out on a few issues, if you'd like triage access you can help
We use the following label scheme to categorize issues:
- **type** - `bug`, `feature`, `question / support`, `discussion`, `greenkeeper`, `maintenance`.
- **type** - `bug`, `feature`, `question / support`, `discussion`, `dependencies`, `maintenance`.
- **area** - `addon: x`, `addons-api`, `stories-api`, `ui`, etc.
- **status** - `needs reproduction`, `needs PR`, `in progress`, etc.
All issues should have a `type` label. `bug`/`feature`/`question`/`discussion` are self-explanatory. `greenkeeper` is for keeping package dependencies up to date. `maintenance` is a catch-all for any kind of cleanup or refactoring.
All issues should have a `type` label. `bug`/`feature`/`question`/`discussion` are self-explanatory. `dependencies` is for keeping package dependencies up to date. `maintenance` is a catch-all for any kind of cleanup or refactoring.
They should also have one or more `area`/`status` labels. We use these labels to filter issues down so we can easily see all of the issues for a particular area, and keep the total number of open issues under control.

View File

@ -24,7 +24,6 @@
"util-deprecate": "^1.0.2"
},
"devDependencies": {
"git-url-parse": "^6.2.2",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-test-renderer": "^16.0.0"

View File

@ -29,7 +29,6 @@
"util-deprecate": "^1.0.2"
},
"devDependencies": {
"git-url-parse": "^6.2.2",
"raw-loader": "^0.5.1",
"react": "^16.0.0",
"react-dom": "^16.0.0",

View File

@ -25,7 +25,6 @@
"util-deprecate": "^1.0.2"
},
"devDependencies": {
"git-url-parse": "^6.2.2",
"react": "^16.0.0",
"react-addons-test-utils": "^15.5.1",
"react-dom": "^16.0.0"

View File

@ -105,7 +105,7 @@ export default function testStorySnapshots(options = {}) {
it(story.name, () => {
const context = { fileName, kind, story: story.name };
options.test({ story, context });
return options.test({ story, context });
});
}
});

View File

@ -5689,19 +5689,6 @@ git-semver-tags@^1.2.2:
meow "^3.3.0"
semver "^5.0.1"
git-up@^2.0.0:
version "2.0.9"
resolved "https://registry.yarnpkg.com/git-up/-/git-up-2.0.9.tgz#219bfd27c82daeead8495beb386dc18eae63636d"
dependencies:
is-ssh "^1.3.0"
parse-url "^1.3.0"
git-url-parse@^6.2.2:
version "6.2.2"
resolved "https://registry.yarnpkg.com/git-url-parse/-/git-url-parse-6.2.2.tgz#be49024e14b8487553436b4572b8b439532fa871"
dependencies:
git-up "^2.0.0"
gitconfiglocal@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz#41d045f3851a5ea88f03f24ca1c6178114464b9b"
@ -6942,12 +6929,6 @@ is-root@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-root/-/is-root-1.0.0.tgz#07b6c233bc394cd9d02ba15c966bd6660d6342d5"
is-ssh@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/is-ssh/-/is-ssh-1.3.0.tgz#ebea1169a2614da392a63740366c3ce049d8dff6"
dependencies:
protocols "^1.1.0"
is-stream@^1.0.0, is-stream@^1.0.1, is-stream@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
@ -9850,13 +9831,6 @@ parse-passwd@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6"
parse-url@^1.3.0:
version "1.3.11"
resolved "https://registry.yarnpkg.com/parse-url/-/parse-url-1.3.11.tgz#57c15428ab8a892b1f43869645c711d0e144b554"
dependencies:
is-ssh "^1.3.0"
protocols "^1.4.0"
parse5@^1.5.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/parse5/-/parse5-1.5.1.tgz#9b7f3b0de32be78dc2401b17573ccaf0f6f59d94"
@ -10520,10 +10494,6 @@ proto-list@~1.2.1:
version "1.2.4"
resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849"
protocols@^1.1.0, protocols@^1.4.0:
version "1.4.6"
resolved "https://registry.yarnpkg.com/protocols/-/protocols-1.4.6.tgz#f8bb263ea1b5fd7a7604d26b8be39bd77678bf8a"
protoduck@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/protoduck/-/protoduck-4.0.0.tgz#fe4874d8c7913366cfd9ead12453a22cd3657f8e"