From 0dafced0d3e37ddc8f0e3c2cd4a81d10d3ae610c Mon Sep 17 00:00:00 2001 From: Michael Neeley Date: Fri, 3 Jun 2022 00:48:13 -0400 Subject: [PATCH] dont run version checker during testing --- __tests__/__snapshots__/index.tests.js.snap | 2 +- index.js | 12 +++++++----- package.json | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/__tests__/__snapshots__/index.tests.js.snap b/__tests__/__snapshots__/index.tests.js.snap index 28f9d85..b74788b 100644 --- a/__tests__/__snapshots__/index.tests.js.snap +++ b/__tests__/__snapshots__/index.tests.js.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`gets the version 1`] = `"0.1.1"`; +exports[`gets the version 1`] = `"0.1.2"`; diff --git a/index.js b/index.js index 41a49d6..e284f4a 100755 --- a/index.js +++ b/index.js @@ -16,11 +16,13 @@ program.name('apollos'); program.version(version); // check version -const { stdout: latest } = execaSync(`${scriptsDir}/get-latest-version.sh`); -if (latest !== version) { - consola.warn( - `Apollos CLI current version: ${version}. Newer version is available: ${latest}`, - ); +if (process.env.NODE_ENV !== 'test') { + const { stdout: latest } = execaSync(`${scriptsDir}/get-latest-version.sh`); + if (latest !== version) { + consola.warn( + `Apollos CLI current version: ${version}. Newer version is available: ${latest}`, + ); + } } program.addCommand(makeMobileCommand()); diff --git a/package.json b/package.json index b23f709..c7d75b0 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ }, "standard-version": { "scripts": { - "prerelease": "yarn test -t version -u", + "postbump": "yarn test -t version -u", "postchangelog": "sed -i \"\" \"s/### \\[/## \\[/g\" CHANGELOG.md", "posttag": "git push --follow-tags origin master && yarn publish . && gh-release --yes" }