plastikfan / TerminalBuddy

Utility module for Windows Terminal
MIT License
0 stars 0 forks source link

Failing tests in StrictMode #16

Closed plastikfan closed 3 years ago

plastikfan commented 4 years ago

When 'StrictMode' is set at the top of the build script, some tests are failing:

[+] C:\Users\Plastikfan\dev\github\PoSh\TerminalBuddy\Elizium.TerminalBuddy\Tests\Internal\join-AllSchemas.tests.ps1 319ms 
(38ms|249ms)
Integrating new theme // ["Scheme name" => "Batman"]
[-] merge-SettingsContent.Given: content with single new scheme.Should: merge the new scheme with Settings 72ms (69ms|3ms)
 PropertyNotFoundException: The property 'schemes' cannot be found on this object. Verify that the property exists.
 at <ScriptBlock>, C:\Users\Plastikfan\dev\github\PoSh\TerminalBuddy\Elizium.TerminalBuddy\Tests\Internal\merge-SettingsContent.tests.ps1:29
Integrating new theme // ["Scheme name" => "Batman"]
Integrating new theme // ["Scheme name" => "Highway"]
[-] merge-SettingsContent.Given: content with multiple (x2) new schemes.Should: merge the new schemes with Settings 95ms (94ms|2ms)
 PropertyNotFoundException: The property 'schemes' cannot be found on this object. Verify that the property exists.        
 at <ScriptBlock>, C:\Users\Plastikfan\dev\github\PoSh\TerminalBuddy\Elizium.TerminalBuddy\Tests\Internal\merge-SettingsContent.tests.ps1:47
Skipping existing theme // ["Scheme name" => "Cyberdyne"]
[-] merge-SettingsContent.Given: content with single scheme already present in settings.Should: not merge new scheme 54ms (53ms|1ms)  
 PropertyNotFoundException: The property 'schemes' cannot be found on this object. Verify that the property exists.
 at <ScriptBlock>, C:\Users\Plastikfan\dev\github\PoSh\TerminalBuddy\Elizium.TerminalBuddy\Tests\Internal\merge-SettingsContent.tests.ps1:64
Integrating new theme // ["Scheme name" => "Batman"]
Skipping existing theme // ["Scheme name" => "Cyberdyne"]
[-] merge-SettingsContent.Given: content with 1 new scheme and 1 existing scheme.Should: only merge the new scheme with Settings 60ms 
(59ms|1ms)
 PropertyNotFoundException: The property 'schemes' cannot be found on this object. Verify that the property exists.
 at <ScriptBlock>, C:\Users\Plastikfan\dev\github\PoSh\TerminalBuddy\Elizium.TerminalBuddy\Tests\Internal\merge-SettingsContent.tests.ps1:82
Skipping existing theme // ["Scheme name" => "Cyberdyne"]
Skipping existing theme // ["Scheme name" => "Chalkboard"]
[-] merge-SettingsContent.Given: content with existing (x2) schemes.Should: not merge new scheme 54ms (52ms|2ms)
 PropertyNotFoundException: The property 'schemes' cannot be found on this object. Verify that the property exists.
 at <ScriptBlock>, C:\Users\Plastikfan\dev\github\PoSh\TerminalBuddy\Elizium.TerminalBuddy\Tests\Internal\merge-SettingsContent.tests.ps1:100
Importing Terminal Scheme // ["No" => "  1", "Scheme filename" => "Banana Blueberry.itermcolors", "Scheme name" => "Banana Blueberry"]

The following needs to be in the build script:

Set-StrictMode -Version Latest
plastikfan commented 3 years ago

Strict-mode 1.0, is adequate and works