mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-13 11:25:13 +00:00
@@ -1,7 +1,9 @@
|
||||
name: compressed-size
|
||||
name: performance
|
||||
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
compressed-size:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
53
.github/workflows/test.yml
vendored
Normal file
53
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
name: test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "master"
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
format:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '14.x'
|
||||
- run: npm install -g yarn
|
||||
- run: yarn install
|
||||
- run: yarn fmt:report
|
||||
|
||||
type-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '14.x'
|
||||
- run: npm install -g yarn
|
||||
- run: yarn install
|
||||
- run: yarn flow
|
||||
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '14.x'
|
||||
- run: npm install -g yarn
|
||||
- run: yarn install
|
||||
- run: yarn lint:report
|
||||
|
||||
unit-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '14.x'
|
||||
- run: npm install -g yarn
|
||||
- run: yarn install
|
||||
- run: yarn jest
|
||||
17
.travis.yml
17
.travis.yml
@@ -1,17 +0,0 @@
|
||||
language: node_js
|
||||
|
||||
node_js:
|
||||
- "10"
|
||||
|
||||
before_install:
|
||||
# Install Yarn
|
||||
- curl -o- -L https://yarnpkg.com/install.sh | bash
|
||||
- export PATH=$HOME/.yarn/bin:$PATH
|
||||
|
||||
cache:
|
||||
yarn: true
|
||||
directories:
|
||||
- node_modules
|
||||
|
||||
script:
|
||||
- yarn test
|
||||
@@ -208,8 +208,8 @@ MIT license.
|
||||
|
||||
[package-badge]: https://img.shields.io/npm/v/react-native-web.svg?style=flat
|
||||
[package-url]: https://yarnpkg.com/en/package/react-native-web
|
||||
[ci-badge]: https://travis-ci.org/necolas/react-native-web.svg?branch=master
|
||||
[ci-url]: https://travis-ci.org/necolas/react-native-web
|
||||
[ci-badge]: https://github.com/necolas/react-native-web/workflows/test/badge.svg
|
||||
[ci-url]: https://github.com/necolas/react-native-web/actions
|
||||
[react-native-url]: https://facebook.github.io/react-native/
|
||||
[contributing-url]: https://github.com/necolas/react-native-web/blob/master/.github/CONTRIBUTING.md
|
||||
[good-first-issue-url]: https://github.com/necolas/react-native-web/labels/good%20first%20issue
|
||||
|
||||
@@ -13,14 +13,15 @@
|
||||
"docs:release": "cd packages/docs && yarn release",
|
||||
"flow": "flow",
|
||||
"fmt": "prettier --write \"**/*.js\"",
|
||||
"fmt:report": "prettier --check \"**/*.js\"",
|
||||
"jest": "jest --config ./scripts/jest/config.js",
|
||||
"lint": "yarn lint:check --fix",
|
||||
"lint:check": "eslint packages scripts",
|
||||
"lint": "yarn lint:report --fix",
|
||||
"lint:report": "eslint packages scripts",
|
||||
"precommit": "lint-staged",
|
||||
"prerelease": "yarn test && yarn compile && yarn compile:commonjs",
|
||||
"release": "node ./scripts/release/publish.js",
|
||||
"postrelease": "yarn benchmarks:release && yarn docs:release",
|
||||
"test": "yarn flow && yarn lint:check && yarn jest --runInBand"
|
||||
"test": "yarn flow && yarn lint:report && yarn jest --runInBand"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.8.4",
|
||||
|
||||
@@ -418,10 +418,14 @@ describe('components/Modal', () => {
|
||||
|
||||
function TestComponent() {
|
||||
React.useEffect(() => spy('mount'), []);
|
||||
return <Modal visible={true}><a ref={(ref) => ref ? spy('ref') : spy('noref')} /></Modal>;
|
||||
return (
|
||||
<Modal visible={true}>
|
||||
<a ref={ref => (ref ? spy('ref') : spy('noref'))} />
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
render(<TestComponent />)
|
||||
render(<TestComponent />);
|
||||
|
||||
expect(spy).toHaveBeenNthCalledWith(1, 'ref');
|
||||
expect(spy).toHaveBeenNthCalledWith(2, 'mount');
|
||||
|
||||
@@ -11,7 +11,6 @@ import * as React from 'react';
|
||||
import mergeRefs from '../mergeRefs';
|
||||
|
||||
export default function useMergeRefs(...args: $ReadOnlyArray<React.ElementRef<any>>) {
|
||||
// TODO(memoize) #1755
|
||||
return React.useMemo(
|
||||
() => mergeRefs(...args),
|
||||
// eslint-disable-next-line
|
||||
|
||||
Reference in New Issue
Block a user