1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-24 01:30:07 +00:00

test(windows): cover versioned install flow

This commit is contained in:
Tw93
2026-03-22 14:49:21 +08:00
parent 16c3ea9867
commit f50d1227ee
4 changed files with 63 additions and 1 deletions

View File

@@ -5,12 +5,15 @@ BeforeAll {
# Get the windows directory path (tests are in windows/tests/)
$script:WindowsDir = Split-Path -Parent $PSScriptRoot
$script:LibDir = Join-Path $script:WindowsDir "lib"
$script:VersionFile = Join-Path $script:WindowsDir "VERSION"
# Import core modules
. "$script:LibDir\core\base.ps1"
. "$script:LibDir\core\log.ps1"
. "$script:LibDir\core\ui.ps1"
. "$script:LibDir\core\file_ops.ps1"
. "$script:LibDir\core\version.ps1"
. "$script:LibDir\core\tui_binaries.ps1"
}
Describe "Base Module" {
@@ -240,3 +243,17 @@ Describe "UI Module" {
}
}
}
Describe "Version Helpers" {
Context "Shared VERSION Source" {
It "Should read the version from VERSION" {
$expected = (Get-Content $script:VersionFile -Raw).Trim()
Get-MoleVersionString -RootDir $script:WindowsDir | Should -Be $expected
}
It "Should keep TUI release lookup aligned with VERSION" {
$expected = (Get-Content $script:VersionFile -Raw).Trim()
Get-MoleVersionFromScriptFile -WindowsDir $script:WindowsDir | Should -Be $expected
}
}
}