-
Notifications
You must be signed in to change notification settings - Fork 801
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Incriment generation only on replacement event(related to #843) * hotRender: drill into the new children branch(fix #843) * tests for the props change case + ci * react-hot-renderer - optional child case
- Loading branch information
Showing
8 changed files
with
112 additions
and
12 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* eslint-env browser */ | ||
import { proxyWrapper } from '../../src/reconciler/proxyAdapter' | ||
import * as proxies from '../../src/reconciler/proxies' | ||
|
||
jest.mock('../../src/reconciler/proxies') | ||
|
||
proxies.getProxyByType.mockReturnValue({ get: () => 'proxy' }) | ||
|
||
describe(`proxyAdapter`, () => { | ||
const fn = () => {} | ||
|
||
it('should handle empty result', () => { | ||
expect(proxyWrapper()).toBe(undefined) | ||
expect(proxyWrapper(null)).toBe(null) | ||
}) | ||
|
||
it('should handle arrays', () => { | ||
expect(proxyWrapper([1, 2, 3])).toEqual([1, 2, 3]) | ||
expect(proxyWrapper([{ type: fn, prop: 42 }])).toEqual([ | ||
{ type: 'proxy', prop: 42 }, | ||
]) | ||
}) | ||
|
||
it('should handle elements', () => { | ||
expect(proxyWrapper({ type: fn, prop: 42 })).toEqual({ | ||
type: 'proxy', | ||
prop: 42, | ||
}) | ||
}) | ||
}) |