Tests are failing on pwsh 7.4 because it stopped accepting `'System.Collections.ArrayList()'` as an argument to `New-Object`.
Removing the extra parentheses should fix the issue.
This will allow, among other things, propagation of the ErrorAction
parameter, and correctly inhibit output when needed.
This behavior is tested in a new test for Get-FeatureFlagConfigFromFile.
Fixes Lack of CmdletBinding prevents ErrorAction from propagating #53
* fix: pin Pester to 4.10.1
This makes tests work under PowerShell 6.0.4.
Also, import the FeatureFlags module first in run-tests.ps1, so that any failures in importing the module are detected early.
* fix: remove BeforeAll/AfterAll
They don't seem to work well with Pester 4.10.1.
If PowerShell ships with a version of Newtonsoft.Json, use it through an assembly binding.
If not, try to load the one we ship with the library.
This will reduce the likelihood of conflicts at assembly loading time, and makes the library
work under Powershell 6.0.x. Fixes#36.
Also, stop whenever there is an error importing the module, to make
debugging easier.
This will remove the dependency from external assemblies in
PowerShell >= 6.1.0, and therefore increase compatibility by
removing the possibility of assembly conflicts or assembly loading
errors.
* Bump Newtonsoft.json from 9.0.1 to 13.0.1
Bumps [Newtonsoft.json](https://github.com/JamesNK/Newtonsoft.Json) from 9.0.1 to 13.0.1.
- [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases)
- [Commits](https://github.com/JamesNK/Newtonsoft.Json/compare/9.0.1...13.0.1)
---
updated-dependencies:
- dependency-name: Newtonsoft.json
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
* fix: add assembly redirect for Newtonsoft.Json
NJsonSchema depends on Newtonsoft.Json 9.x, which we are upgrading
to 13. Adding an assembly resolver so that the NJsonSchema library
references the updated Newtonsoft.Json assembly.
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrea Spadaccini <andrea.spadaccini@microsoft.com>
Co-authored-by: Andrea Spadaccini <andreas@microsoft.com>
* change the address to be the public one rather than a private Azure DevOps repo;
* remove the schema version, because the JSON Schema library I'm targeting for the next upgrade fails to parse the schema if I specify the version.
* feat: only run on Pester 5.3.3
* fix: skip publisher check when installing Pester
This is a legitimate skip, as the publisher between major Pester versions may
change.
* feat: ignore coverage results
There is a 1/100 chance that a probability check with probability 0
would give the wrong result, because if the random number is 0 the old
code would check if 0 > 0, which is of course false.
Change the test to ≥ to account for this corner case.
Fixes#18.
For some reason, it looks like the NJsonSchema library exports a
NJsonSchema object if queried from .NET Core, but if queried
from .NET Framework (Windows PowerShell) it exports a
NJsonSchema4 object. From the same DLL.
This is a workaround to fallback to NJsonSchema4 if NJsonSchema
doesn't seem available, which makes the library work for
Windows PowerShell.
Looks like the PowerShell prefix is reserved in NuGet, so renaming the
package to FeatureFlags.PowerShell in NuGet.
Also fixing the license specification to use the new syntax.