A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/chenesan/react/commit/b2dff28909247342cfcb9ced2fbe24a0f9ca08b7 below:

Add failed test for useCallback in shallow renderer test suite · chenesan/react@b2dff28 · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+16

-0

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+16

-0

lines changed Original file line number Diff line number Diff line change

@@ -290,6 +290,22 @@ describe('ReactShallowRenderer with hooks', () => {

290 290

expect(firstResult).toEqual(secondResult);

291 291

});

292 292 293 +

it('should work with useCallback', () => {

294 +

function SomeComponent() {

295 +

const noop = React.useCallback(() => {}, []);

296 + 297 +

return (

298 +

<div onClick={noop} />

299 +

);

300 +

}

301 + 302 +

const shallowRenderer = createRenderer();

303 +

let firstResult = shallowRenderer.render(<SomeComponent />);

304 +

let secondResult = shallowRenderer.render(<SomeComponent />);

305 + 306 +

expect(firstResult).toEqual(secondResult);

307 +

});

308 + 293 309

it('should work with useContext', () => {

294 310

const SomeContext = React.createContext('default');

295 311

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4