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 21, 2021
1 parent 0d999ef commit 93136db
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
Original file line number Diff line number Diff line change
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 93136db

Please sign in to comment.