Skip to content

Commit f59e927

Browse files
committed
version detection: Add tests
- Warn only once for failure to detect react version Ref: jsx-eslint#2276
1 parent d6832d6 commit f59e927

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/util/version.js

+9
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@ describe('Version', () => {
4444
];
4545
});
4646

47+
it('warns only once for failure to detect react ', () => {
48+
assert.equal(versionUtil.testReactVersion(context, '999.999.999'), true);
49+
assert.equal(versionUtil.testReactVersion(context, '999.999.999'), true);
50+
51+
expectedErrorArgs = [
52+
['Warning: React version was set to "detect" in eslint-plugin-react settings, but the "react" package is not installed. Assuming latest React version for linting.']
53+
];
54+
});
55+
4756
it('assumes latest version if flow-bin is not installed', () => {
4857
assert.equal(versionUtil.testFlowVersion(context, '999.999.999'), true);
4958

0 commit comments

Comments
 (0)