Skip to content

Commit

Permalink
version detection: Add tests
Browse files Browse the repository at this point in the history
- Warn only once for failure to detect react version

Ref: jsx-eslint#2276
  • Loading branch information
abhishekdev committed Jun 28, 2019
1 parent d6832d6 commit f59e927
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/util/version.js
Expand Up @@ -44,6 +44,15 @@ describe('Version', () => {
];
});

it('warns only once for failure to detect react ', () => {
assert.equal(versionUtil.testReactVersion(context, '999.999.999'), true);
assert.equal(versionUtil.testReactVersion(context, '999.999.999'), true);

expectedErrorArgs = [
['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.']
];
});

it('assumes latest version if flow-bin is not installed', () => {
assert.equal(versionUtil.testFlowVersion(context, '999.999.999'), true);

Expand Down

0 comments on commit f59e927

Please sign in to comment.