This is an automated email from the ASF dual-hosted git repository. dpogue pushed a commit to branch availability-test in repository https://gitbox.apache.org/repos/asf/cordova-ios.git
commit 3564a3072aef00eb9b092a295f379826d5fb366e Author: Darryl Pogue <[email protected]> AuthorDate: Thu Jun 4 21:48:13 2026 -0700 test(api): Add test for CORDOVA_VERSION_MIN_REQUIRED --- tests/spec/CDVAvailability.spec.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tests/spec/CDVAvailability.spec.js b/tests/spec/CDVAvailability.spec.js index ab8f423a..7ca40d8d 100644 --- a/tests/spec/CDVAvailability.spec.js +++ b/tests/spec/CDVAvailability.spec.js @@ -22,14 +22,25 @@ const path = require('node:path'); const semver = require('semver'); const VERSION = require(path.resolve(__dirname, '..', '..', 'package.json')).version; +const pkgVersion = semver.coerce(VERSION).version; +const versionDefine = `__CORDOVA_${pkgVersion.split('.').join('_')}`; + +const headerPath = path.resolve(__dirname, '..', '..', 'CordovaLib', 'include', 'Cordova', 'CDVAvailability.h'); + describe('CDVAvailability.h', () => { - it('should contain a definition for the current package version', () => { - const pkgVersion = semver.coerce(VERSION).version; - const versionDefine = `__CORDOVA_${pkgVersion.split('.').join('_')}`; + let headerText = ''; - const headerPath = path.resolve(__dirname, '..', '..', 'CordovaLib', 'include', 'Cordova', 'CDVAvailability.h'); - const headerText = fs.readFileSync(headerPath, 'utf8'); + beforeAll(() => { + headerText = fs.readFileSync(headerPath, 'utf8'); + }); + it('should contain a definition for the current package version', () => { expect(headerText).toMatch(versionDefine); }); + + it('should define the current version as CORDOVA_VERSION_MIN_REQUIRED', () => { + const minRequired = `#define CORDOVA_VERSION_MIN_REQUIRED ${versionDefine}`; + + expect(headerText).toMatch(minRequired); + }); }); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
