Skip to content

Commit

Permalink
restore a test
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenWeatherford committed Feb 6, 2025
1 parent fef0f0e commit 7b55cb0
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,26 @@ private async Task<CliResult> Test(Options options)
return await Bicep(settings, "lint", mainFile, options.NoRestore ? "--no-restore" : null);
}

[TestMethod]
public async Task IfLevelIsOff_ShouldNotDownloadModuleMetadata()
{
var result = await Test(new Options(CacheRoot)
{
Bicep = """
module m1 '{PREFIX}/fake/avm/res/app/container-app:0.2.0' = {
name: 'm1'
}
""".Replace("{PREFIX}", PREFIX),
DiagnosticLevel = "off",
PublishedModules = [$"{PREFIX}/fake/avm/res/app/container-app:0.2.0"],
MetadataClient = PublicModuleIndexHttpClientMocks.CreateToThrow(new Exception("unit test failed: shouldn't try to download in this scenario")).Object,
});

result.Should().NotHaveStderr();
result.Should().HaveStdout("");
result.Should().Succeed();
}

[TestMethod]
// We don't currently cache to disk, but rather on every check to restore modules.
public async Task IfNoRestoreSpecified_ThenShouldNotDownloadMetadata_AndShouldFailBecauseNoCache()
Expand Down

0 comments on commit 7b55cb0

Please sign in to comment.