Skip to content

Commit

Permalink
[Tests]: version util test to mock "no react installed" case
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio committed Apr 11, 2021
1 parent 15b8f51 commit 4632cea
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file.
4 changes: 4 additions & 0 deletions tests/util/version.js
Expand Up @@ -56,6 +56,8 @@ describe('Version', () => {
});

it('assumes latest version if react is not installed', () => {
sinon.stub(context, 'getFilename').callsFake(() => path.resolve(base, 'detect-version-missing', 'test.js'));

assert.equal(versionUtil.testReactVersion(context, '999.999.999'), true);

expectedErrorArgs = [
Expand All @@ -64,6 +66,8 @@ describe('Version', () => {
});

it('warns only once for failure to detect react ', () => {
sinon.stub(context, 'getFilename').callsFake(() => path.resolve(base, 'detect-version-missing', 'test.js'));

assert.equal(versionUtil.testReactVersion(context, '999.999.999'), true);
assert.equal(versionUtil.testReactVersion(context, '999.999.999'), true);

Expand Down

0 comments on commit 4632cea

Please sign in to comment.