Skip to content

Commit 1612436

Browse files
committed
Add more specific warning assertion for React DOM factories
1 parent da03cba commit 1612436

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/addons/__tests__/ReactDOMFactories-test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('ReactDOMFactories', () => {
1919
spyOn(console, 'error');
2020
var element = div();
2121
expect(element.type).toBe('div');
22-
expectDev(console.error.calls.count()).toBe(0);
22+
expectDev(console.error).not.toHaveBeenCalled();
2323
});
2424

2525
it('warns once when accessing React.DOM methods', () => {
@@ -31,6 +31,9 @@ describe('ReactDOMFactories', () => {
3131
expect(a.type).toBe('a');
3232
expect(p.type).toBe('p');
3333

34-
expectDev(console.error.calls.count()).toBe(1);
34+
expectDev(console.error).toHaveBeenCalledTimes(1);
35+
expectDev(console.error.calls.first().args[0]).toContain(
36+
'Warning: Accessing factories like React.DOM.a has been deprecated'
37+
);
3538
});
3639
});

0 commit comments

Comments
 (0)