hana-cli
Version:
HANA Developer Command Line Interface
41 lines (34 loc) • 1.42 kB
JavaScript
// @ts-nocheck
/**
* @module VersionCheck Tests - Unit tests for version checking utilities
*/
import { assert } from '../base.js'
import { checkVersion } from '../../utils/versionCheck.js'
describe('Version Check Utilities', function () {
describe('checkVersion', function () {
this.timeout(10000) // Version checking may take a few seconds
it('should return a promise', function () {
const result = checkVersion()
assert.ok(result instanceof Promise)
})
it('should resolve without errors', async function () {
// This test will check the current Node.js version against package.json requirements
try {
await checkVersion()
// If we get here, the promise resolved successfully
assert.ok(true)
} catch (error) {
// Should not throw errors, just resolve
assert.fail('checkVersion should not throw errors')
}
})
it('should complete within timeout', async function () {
const startTime = Date.now()
await checkVersion()
const endTime = Date.now()
const duration = endTime - startTime
// Should complete within a reasonable time (less than 5 seconds)
assert.ok(duration < 5000, `Version check took ${duration}ms`)
})
})
})