Skip to content

Commit 2c181b8

Browse files
greenkeeper[bot]thymikee
authored andcommitted
Update flow-bin to the latest version 🚀 (#183)
* chore(package): update flow-bin to version 0.99.0 * chore(package): update lockfile yarn.lock * Fix flow
1 parent 9227012 commit 2c181b8

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"conventional-changelog-cli": "^2.0.11",
2727
"dedent": "^0.7.0",
2828
"eslint": "^5.15.2",
29-
"flow-bin": "^0.98.0",
29+
"flow-bin": "^0.99.0",
3030
"flow-copy-source": "^2.0.6",
3131
"jest": "^24.7.1",
3232
"metro-react-native-babel-preset": "^0.52.0",

src/__tests__/debug.test.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import stripAnsi from 'strip-ansi';
66
import { debug, render, fireEvent, flushMicrotasksQueue } from '..';
77
import debugShallow from '../helpers/debugShallow';
88

9+
type ConsoleLogMock = JestMockFn<Array<string>, void>;
10+
911
function TextComponent({ text }) {
1012
return <Text>{text}</Text>;
1113
}
@@ -30,17 +32,16 @@ class Button extends React.Component<*, *> {
3032
}
3133

3234
test('debug', () => {
33-
// $FlowFixMe
34-
console.log = jest.fn();
35+
jest.spyOn(console, 'log').mockImplementation(x => x);
3536
const component = <Button onPress={jest.fn} text="Press me" />;
3637
debug(component);
3738

38-
const output = console.log.mock.calls[0][0];
39+
const output = (console.log: ConsoleLogMock).mock.calls[0][0];
3940

4041
expect(stripAnsi(output)).not.toEqual(output);
4142
expect(stripAnsi(output)).toMatchSnapshot();
4243

43-
console.log.mockReset();
44+
(console.log: ConsoleLogMock).mockReset();
4445

4546
debug(component, 'test message');
4647

@@ -57,12 +58,12 @@ test('debug.deep', () => {
5758
const component = <Button onPress={jest.fn} text="Press me" />;
5859
debug.deep(component);
5960

60-
const output = console.log.mock.calls[0][0];
61+
const output = (console.log: ConsoleLogMock).mock.calls[0][0];
6162

6263
expect(stripAnsi(output)).not.toEqual(output);
6364
expect(stripAnsi(output)).toMatchSnapshot();
6465

65-
console.log.mockReset();
66+
(console.log: ConsoleLogMock).mockReset();
6667

6768
debug.deep(component, 'test message');
6869

@@ -81,7 +82,7 @@ test('debug.deep async test', async () => {
8182

8283
debug.deep(toJSON());
8384

84-
const output = console.log.mock.calls[0][0];
85+
const output = (console.log: ConsoleLogMock).mock.calls[0][0];
8586

8687
expect(stripAnsi(output)).toMatchSnapshot();
8788
});

src/__tests__/render.test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import {
1111
import stripAnsi from 'strip-ansi';
1212
import { render, fireEvent } from '..';
1313

14+
type ConsoleLogMock = JestMockFn<Array<string>, void>;
15+
1416
const PLACEHOLDER_FRESHNESS = 'Add custom freshness';
1517
const PLACEHOLDER_CHEF = 'Who inspected freshness?';
1618

@@ -269,7 +271,7 @@ test('debug', () => {
269271
debug.shallow('my other custom message');
270272

271273
// eslint-disable-next-line no-console
272-
const mockCalls = console.log.mock.calls;
274+
const mockCalls = (console.log: ConsoleLogMock).mock.calls;
273275

274276
expect(stripAnsi(mockCalls[0][0])).toMatchSnapshot();
275277
expect(stripAnsi(mockCalls[1][0] + mockCalls[1][1])).toMatchSnapshot(
@@ -291,7 +293,7 @@ test('debug changing component', () => {
291293
debug();
292294

293295
// eslint-disable-next-line no-console
294-
const mockCalls = console.log.mock.calls;
296+
const mockCalls = (console.log: ConsoleLogMock).mock.calls;
295297

296298
expect(stripAnsi(mockCalls[4][0])).toMatchSnapshot(
297299
'bananaFresh button message should now be "fresh"'

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3250,10 +3250,10 @@ flatted@^2.0.0:
32503250
resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916"
32513251
integrity sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg==
32523252

3253-
flow-bin@^0.98.0:
3254-
version "0.98.0"
3255-
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.98.0.tgz#3361a03682326a83a5f0a864749f4f7f0d826bce"
3256-
integrity sha512-vuiYjBVt82eYF+dEk9Zqa8hTSDvbhl/czxzFRLZm9/XHbJnYNMTwFoNFYAQT9IQ6ACNBIbwSTIfxroieuKja7g==
3253+
flow-bin@^0.99.0:
3254+
version "0.99.0"
3255+
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.99.0.tgz#df035be2493825ddce0b2f26d1273747465b538c"
3256+
integrity sha512-PjTzcOwte2mq+aP+HFCQZw/AojltOnOdtZC9iPzkWJJdPH7nYSKkZhC4dFgP24BuXsJH6yZBZ48gEKsX04UegQ==
32573257

32583258
flow-copy-source@^2.0.6:
32593259
version "2.0.6"

0 commit comments

Comments
 (0)