@samitouri / QOS-React-2 / commits / a4e5327b76

Remove jest usage in ReactDescriptorTest

Until we're only using jest on github, we should stick with Jasmine spies. Soon, hopefully.

Paul O'Shannessy committed Jun 30, 2014 at 20:53 UTC a4e5327b7618d18a728a333268cf26ce1aa1659d
1 file changed +9 -4
src/core/__tests__/ReactDescriptor-test.js
+9 -4
@@ -49,13 +49,18 @@ describe('ReactDescriptor', function() {
49 it('immediately calls the type passed to createDescriptor', function() {
50 var a = 1, b = 2, c = 3, d = 4;
51
52 - var foo = jest.genMockFunction();
53 - foo.mockReturnValue(d);
52 + // TODO: Switch back to using jest.genMockFunction when we run jest in
53 + // github repo.
54 + var test = {
55 + foo: function() { return d; }
56 + };
57
55 - var result = React.createDescriptor(foo, a, b, c);
58 + spyOn(test, 'foo').andCallThrough();
59 +
60 + var result = React.createDescriptor(test.foo, a, b, c);
61
62 expect(result).toBe(d);
58 - expect(foo).toBeCalledWith(a, b, c);
63 + expect(test.foo).toHaveBeenCalledWith(a, b, c);
64 });
65
66 });