Skip to content
This repository has been archived by the owner on Jul 8, 2021. It is now read-only.

Commit

Permalink
Merge pull request #29 from rhysforyou/feature/jsx3
Browse files Browse the repository at this point in the history
JSX 3 & bs-platform@8
  • Loading branch information
rhysforyou authored Jul 31, 2020
2 parents 6d0af7d + edded40 commit 7203349
Show file tree
Hide file tree
Showing 8 changed files with 5,344 additions and 4,703 deletions.
2 changes: 1 addition & 1 deletion bsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bs-enzyme",
"reason": { "react-jsx": 2 },
"reason": { "react-jsx": 3 },
"bs-dependencies": ["reason-react"],
"bs-dev-dependencies": ["@glennsl/bs-jest"],
"bsc-flags": ["-bs-super-errors"],
Expand Down
9,799 changes: 5,221 additions & 4,578 deletions package-lock.json

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@
},
"homepage": "https://github.com/rpowelll/bs-enzyme#readme",
"devDependencies": {
"@babel/preset-env": "7.3.4",
"@glennsl/bs-jest": "0.4.8",
"bs-platform": "4.0.18",
"enzyme-adapter-react-16": "1.11.2",
"jest": "24.5.0",
"react": "16.8.4",
"react-dom": "16.8.4",
"reason-react": "0.6.0",
"standard-version": "8.0.1"
"@babel/preset-env": "7.10.4",
"@glennsl/bs-jest": "0.5.1",
"bs-platform": "8.0.3",
"enzyme-adapter-react-16": "1.15.2",
"jest": "26.1.0",
"react": "16.13.1",
"react-dom": "16.13.1",
"reason-react": "0.9.1",
"standard-version": "8.0.2"
},
"dependencies": {
"enzyme": "3.9.0",
"react-test-renderer": "16.8.4"
"enzyme": "3.11.0",
"react-test-renderer": "16.13.1"
},
"peerDependencies": {
"bs-platform": ">=4.0.0",
"reason-react": ">=0.5.0"
"bs-platform": ">=8.0.0",
"reason-react": ">=0.9.0"
}
}
14 changes: 10 additions & 4 deletions src/Enzyme.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 28 additions & 44 deletions src/__tests__/DummyComponent.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 17 additions & 17 deletions src/__tests__/DummyComponent.re
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@ type state = {clicked: bool};
type action =
| Click;

let se = ReasonReact.string;
let se = React.string;

let component = ReasonReact.reducerComponent("DummyComponent");

let make = (~title, _children) => {
...component,
initialState: () => {clicked: false},
reducer: (action, state) =>
[@react.component]
let make = (~title) => {
let (state, dispatch) = React.useReducer(
(state, action) =>
switch action {
| Click => ReasonReact.Update({clicked: ! state.clicked})
| Click => {clicked: !state.clicked}
},
render: (self) =>
<div className="dummy">
<div id="header"> <h1> (se(title)) </h1> </div>
<div id="content">
<button id="click-me" onClick=((_event) => self.send(Click))>
(se(self.state.clicked ? "I've been clicked!" : "Click Me!"))
</button>
<ul id="list"> <li> (se("One")) </li> <li> (se("Two")) </li> <li> (se("Three")) </li> </ul>
</div>
{clicked: false}
);

<div className="dummy">
<div id="header"> <h1> (se(title)) </h1> </div>
<div id="content">
<button id="click-me" onClick=((_event) => dispatch(Click))>
(se(state.clicked ? "I've been clicked!" : "Click Me!"))
</button>
<ul id="list"> <li> (se("One")) </li> <li> (se("Two")) </li> <li> (se("Three")) </li> </ul>
</div>
</div>
};
89 changes: 47 additions & 42 deletions src/__tests__/DummyComponent_test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7203349

Please sign in to comment.