Skip to content

Commit

Permalink
test(dotnet): move Evaluate test from .playground.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
BinToss committed Aug 18, 2024
1 parent 3f0144b commit 2d60fff
Showing 1 changed file with 372 additions and 0 deletions.
372 changes: 372 additions & 0 deletions tests/dotnet/MSBuildProject.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import {
import {
MSBuildProject as MSBP,
} from '../../src/dotnet/MSBuildProject.js'
import { promisify } from 'node:util'
import { exists } from 'node:fs'

await describe('MSBuildProject', async (c00) => {
await it('is exposed', () => {
Expand All @@ -30,4 +32,374 @@ await describe('MSBuildProject', async (c00) => {
)
})
})
await describe('Evaluate', async (c00) => {
await it('has expected name', () => {
deepStrictEqual(MSBP.Evaluate.name, c00.name)
})
await it('may return expected object (BinToss/GroupBox.Avalonia)', { skip: !await promisify(exists)('C:\\Repos\\BinToss\\GroupBox.Avalonia\\GroupBox.Avalonia') }, async () => {
deepStrictEqual(
JSON.parse(JSON.stringify(await MSBP.Evaluate({
FullName: 'C:\\Repos\\BinToss\\GroupBox.Avalonia\\GroupBox.Avalonia',
GetItem: ['AvaloniaXaml'],
GetProperty: [...MSBP.MatrixProperties],
GetTargetResults: [],
Properties: {},
Target: ['Restore', 'Pack'],
}))),
{
Items: {
AvaloniaXaml: [
{
Identity: 'Controls\\GroupBox.axaml',
SubType: 'Designer',
FullPath: 'C:\\Repos\\BinToss\\GroupBox.Avalonia\\GroupBox.Avalonia\\Controls\\GroupBox.axaml',
RootDir: 'C:\\',
Filename: 'GroupBox',
Extension: '.axaml',
RelativeDir: 'Controls\\',
Directory: 'Repos\\BinToss\\GroupBox.Avalonia\\GroupBox.Avalonia\\Controls\\',
RecursiveDir: 'Controls\\',
ModifiedTime: '',
CreatedTime: '',
AccessedTime: '',
DefiningProjectFullPath: 'C:\\Users\\Noah\\.nuget\\packages\\avalonia\\11.1.1\\buildTransitive\\AvaloniaBuildTasks.props',
DefiningProjectDirectory: 'C:\\Users\\Noah\\.nuget\\packages\\avalonia\\11.1.1\\buildTransitive\\',
DefiningProjectName: 'AvaloniaBuildTasks',
DefiningProjectExtension: '.props',
},
{
Identity: 'Themes\\GroupBoxBasic.axaml',
SubType: 'Designer',
FullPath: 'C:\\Repos\\BinToss\\GroupBox.Avalonia\\GroupBox.Avalonia\\Themes\\GroupBoxBasic.axaml',
RootDir: 'C:\\',
Filename: 'GroupBoxBasic',
Extension: '.axaml',
RelativeDir: 'Themes\\',
Directory: 'Repos\\BinToss\\GroupBox.Avalonia\\GroupBox.Avalonia\\Themes\\',
RecursiveDir: 'Themes\\',
ModifiedTime: '',
CreatedTime: '',
AccessedTime: '',
DefiningProjectFullPath: 'C:\\Users\\Noah\\.nuget\\packages\\avalonia\\11.1.1\\buildTransitive\\AvaloniaBuildTasks.props',
DefiningProjectDirectory: 'C:\\Users\\Noah\\.nuget\\packages\\avalonia\\11.1.1\\buildTransitive\\',
DefiningProjectName: 'AvaloniaBuildTasks',
DefiningProjectExtension: '.props',
},
{
Identity: 'Themes\\GroupBoxClassic.axaml',
SubType: 'Designer',
FullPath: 'C:\\Repos\\BinToss\\GroupBox.Avalonia\\GroupBox.Avalonia\\Themes\\GroupBoxClassic.axaml',
RootDir: 'C:\\',
Filename: 'GroupBoxClassic',
Extension: '.axaml',
RelativeDir: 'Themes\\',
Directory: 'Repos\\BinToss\\GroupBox.Avalonia\\GroupBox.Avalonia\\Themes\\',
RecursiveDir: 'Themes\\',
ModifiedTime: '',
CreatedTime: '',
AccessedTime: '',
DefiningProjectFullPath: 'C:\\Users\\Noah\\.nuget\\packages\\avalonia\\11.1.1\\buildTransitive\\AvaloniaBuildTasks.props',
DefiningProjectDirectory: 'C:\\Users\\Noah\\.nuget\\packages\\avalonia\\11.1.1\\buildTransitive\\',
DefiningProjectName: 'AvaloniaBuildTasks',
DefiningProjectExtension: '.props',
},
],
},
Properties: {
_msbuildProjectFullPath: 'C:\\Repos\\BinToss\\GroupBox.Avalonia\\GroupBox.Avalonia',
_runtimeIdentifier: '',
_runtimeIdentifiers: '',
_targetFramework: 'net6.0',
_targetFrameworks: '',
targetframework: 'net6.0',
targetframeworks: '',
runtimeidentifier: '',
runtimeidentifiers: '',
},
Targets: [
'AddAvaloniaResources',
'AddDepsJsonAndRuntimeConfigToCopyItemsForReferencingProjects',
'AddDepsJsonAndRuntimeConfigToPublishItemsForReferencingProjects',
'AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisNetAnalyzers',
'AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisNetAnalyzersDesign',
'AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisNetAnalyzersDocumentation',
'AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisNetAnalyzersGlobalization',
'AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisNetAnalyzersInteroperability',
'AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisNetAnalyzersMaintainability',
'AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisNetAnalyzersNaming',
'AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisNetAnalyzersPerformance',
'AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisNetAnalyzersReliability',
'AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisNetAnalyzersSecurity',
'AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisNetAnalyzersUsage',
'AddImplicitDefineConstants',
'AddReferencePathsToRealAvaloniaAssemblies',
'AddRuntimeConfigFileToBuiltProjectOutputGroupOutput',
'AddSourceRevisionToInformationalVersion',
'AddTransitiveFrameworkReferences',
'AddWindowsSdkKnownFrameworkReferences',
'AdjustDefaultPlatformTargetForNetFrameworkExeWithNoNativeCopyLocalItems',
'AfterBuild',
'AfterClean',
'AfterCompile',
'AfterPublish',
'AfterRebuild',
'AfterResGen',
'AfterResolveReferences',
'AfterSdkPublish',
'AllProjectOutputGroups',
'AllProjectOutputGroupsDependencies',
'ApplyImplicitVersions',
'AssignLinkMetadata',
'AssignProjectConfiguration',
'AssignTargetPaths',
'AvaloniaDeleteRefAssemblyBeforeOutputCopy',
'AvaloniaFilePreview',
'AvaloniaStats',
'Avalonia_CollectUpToDateCheckOutputDesignTime',
'BeforeBuild',
'BeforeClean',
'BeforeCompile',
'BeforePublish',
'BeforeRebuild',
'BeforeResGen',
'BeforeResolveReferences',
'Build',
'BuildCompile',
'BuildCompileTraverse',
'BuildGenerateSources',
'BuildGenerateSourcesTraverse',
'BuildLink',
'BuildLinkTraverse',
'BuildOnlySettings',
'BuildProject',
'BuiltProjectOutputGroup',
'BuiltProjectOutputGroupDependencies',
'CheckForDuplicateItems',
'CheckForImplicitPackageReferenceOverrides',
'Clean',
'CleanAppxPackage',
'CleanPublishFolder',
'CleanReferencedProjects',
'CollectApiCompatInputs',
'CollectCentralPackageVersions',
'CollectFrameworkReferences',
'CollectNuGetAuditSuppressions',
'CollectPackageDownloads',
'CollectPackageReferences',
'CollectReferencedNuGetPackages',
'CollectResolvedSDKReferencesDesignTime',
'CollectSDKReferencesDesignTime',
'Compile',
'CompileAvaloniaXaml',
'CompileLicxFiles',
'ComposeStore',
'ComputeAndCopyFilesToPublishDirectory',
'ComputeAndCopyFilesToStoreDirectory',
'ComputeContainerBaseImage',
'ComputeContainerConfig',
'ComputeDependencyFileCompilerOptions',
'ComputeEmbeddedApphostPaths',
'ComputeFilesCopiedToPublishDir',
'ComputeFilesToPublish',
'ComputeFilesToStore',
'ComputeIntermediateSatelliteAssemblies',
'ComputeRefAssembliesToPublish',
'ComputeResolvedFilesToPublishList',
'ContentFilesProjectOutputGroup',
'CopyAdditionalFiles',
'CopyFilesToOutputDirectory',
'CopyFilesToPublishDirectory',
'CopyFilesToStoreDirectory',
'CopyRunEnvironmentFiles',
'CoreBuild',
'CoreClean',
'CoreCompile',
'CoreGenerateAssemblyInfo',
'CoreGenerateSatelliteAssemblies',
'CoreResGen',
'CreateCompilerGeneratedFilesOutputPath',
'CreateCustomManifestResourceNames',
'CreateGeneratedAssemblyInfoInputsCacheFile',
'CreateManifestResourceNames',
'CreateReadyToRunImages',
'CreateSatelliteAssemblies',
'DebugSymbolsProjectOutputGroup',
'DebugSymbolsProjectOutputGroupDependencies',
'DefaultCopyToPublishDirectoryMetadata',
'DesignTimeResolveAssemblyReferences',
'DesignerRuntimeImplementationProjectOutputGroup',
'DocumentationProjectOutputGroup',
'DocumentationProjectOutputGroupDependencies',
'EnableIntermediateOutputPathMismatchWarning',
'EnsureNETCoreAppRuntime',
'ExpandSDKReferences',
'ExpandSDKReferencesDesignTime',
'ExportWindowsMDFile',
'FindInvalidProjectReferences',
'FindReferenceAssembliesForReferences',
'GenerateAdditionalSources',
'GenerateApplicationManifest',
'GenerateAssemblyInfo',
'GenerateAvaloniaResources',
'GenerateBindingRedirects',
'GenerateBindingRedirectsUpdateAppConfig',
'GenerateBuildDependencyFile',
'GenerateBuildRuntimeConfigurationFiles',
'GenerateDeploymentManifest',
'GenerateGitVersionInformation',
'GenerateGlobalUsings',
'GenerateMSBuildEditorConfigFile',
'GenerateMSBuildEditorConfigFileCore',
'GenerateMSBuildEditorConfigFileShouldRun',
'GenerateManifests',
'GenerateNETCompatibleDefineConstants',
'GenerateNuspec',
'GeneratePlatformCompatibleDefineConstants',
'GeneratePublishDependencyFile',
'GenerateRestoreGraphFile',
'GenerateSatelliteAssemblies',
'GenerateSerializationAssemblies',
'GenerateShimsAssets',
'GenerateSingleFileBundle',
'GenerateSourceLinkFile',
'GenerateSupportedRuntime',
'GenerateSupportedTargetFrameworkAlias',
'GenerateTargetFrameworkMonikerAttribute',
'GenerateTargetPlatformDefineConstants',
'GenerateToolsSettingsFileFromBuildProperty',
'GetAllRuntimeIdentifiers',
'GetAssemblyAttributes',
'GetAssemblyVersion',
'GetCompile',
'GetCopyToOutputDirectoryItems',
'GetCopyToPublishDirectoryItems',
'GetFrameworkPaths',
'GetInstalledSDKLocations',
'GetItemTargetPaths',
'GetNativeManifest',
'GetPackagingOutputs',
'GetPotentialEditorConfigFiles',
'GetReferenceAssemblyPaths',
'GetReferenceTargetPlatformMonikers',
'GetReferencesForApiCompatValidatePackage',
'GetResolvedSDKReferences',
'GetSuggestedWorkloads',
'GetTargetFrameworkDirectories',
'GetTargetFrameworkMoniker',
'GetTargetFrameworkMonikerDisplayName',
'GetTargetFrameworkProperties',
'GetTargetFrameworkVersion',
'GetTargetFrameworks',
'GetTargetFrameworksWithPlatformForSingleTargetFramework',
'GetTargetPath',
'GetTargetPathWithTargetPlatformMoniker',
'GetVersion',
'ILLink',
'IgnoreJavaScriptOutputAssembly',
'IncludeTargetingPackReference',
'IncludeTransitiveProjectReferences',
'IncrementalClean',
'InitializeSourceControlInformation',
'InitializeSourceControlInformationFromSourceControlManager',
'InitializeSourceRootMappedPaths',
'InjectAvaloniaXamlOutput',
'InjectIlcAvaloniaXamlOutput',
'Pack',
'PackTool',
'PostBuildEvent',
'PreBuildEvent',
'PrepOptimizer',
'PrepRestoreForStoreProjects',
'PrepareForBuild',
'PrepareForBundle',
'PrepareForComposeStore',
'PrepareForPublish',
'PrepareForRun',
'PrepareProjectReferences',
'PrepareResourceNames',
'PrepareResources',
'PrepareToCompileAvaloniaXaml',
'PrepforRestoreForComposeStore',
'PreventPackingAvaloniaUnstableApis',
'PriFilesOutputGroup',
'ProcessFrameworkReferences',
'Publish',
'PublishBuild',
'PublishContainer',
'PublishItemsOutputGroup',
'PublishOnly',
'Rebuild',
'ReferenceCopyLocalPathsOutputGroup',
'RemoveAvaloniaRefAssemblies',
'ResGen',
'ResolveAssemblyReferences',
'ResolveAssemblyReferencesDesignTime',
'ResolveCodeAnalysisRuleSet',
'ResolveComReferences',
'ResolveComReferencesDesignTime',
'ResolveFrameworkReferences',
'ResolveKeySource',
'ResolveLockFileAnalyzers',
'ResolveLockFileCopyLocalFiles',
'ResolveLockFileReferences',
'ResolveNativeReferences',
'ResolveOffByDefaultAnalyzers',
'ResolvePackageAssets',
'ResolvePackageDependenciesDesignTime',
'ResolvePackageDependenciesForBuild',
'ResolveProjectReferences',
'ResolveProjectReferencesDesignTime',
'ResolveReadyToRunCompilers',
'ResolveReferences',
'ResolveRuntimePackAssets',
'ResolveSDKReferences',
'ResolveSDKReferencesDesignTime',
'ResolveTargetingPackAssets',
'Restore',
'RestoreForComposeStore',
'Run',
'RunCrossGen',
'RunGitVersion',
'RunPackageValidation',
'RunProduceContentAssets',
'RunResolvePackageDependencies',
'RunResolvePublishAssemblies',
'SDKRedistOutputGroup',
'SGenFilesOutputGroup',
'SGenFilesOutputGroupDependencies',
'SatelliteDllsProjectOutputGroup',
'SatelliteDllsProjectOutputGroupDependencies',
'SetEmbeddedFilesFromSourceControlManagerUntrackedFiles',
'SetGenerateManifests',
'SetWin32ManifestProperties',
'ShimReferencePathsWhenCommonTargetsDoesNotUnderstandReferenceAssemblies',
'ShowCallOfVSTestTaskWithParameter',
'ShowInfoMessageIfProjectHasNoIsTestProjectProperty',
'ShowMsbuildWithParameter',
'SourceControlManagerPublishTranslatedUrls',
'SourceFilesProjectOutputGroup',
'SplitResourcesByCulture',
'StoreFinalizer',
'StoreResolver',
'StoreWorkerMain',
'StoreWorkerMapper',
'StoreWorkerPerformWork',
'TranslateGitHubUrlsInSourceControlInformation',
'UnmanagedRegistration',
'UnmanagedUnregistration',
'UpdateAspNetToFrameworkReference',
'UpdateAssemblyInfo',
'VSTest',
'ValidateCommandLineProperties',
'ValidateExecutableReferences',
'WarnForExplicitVersions',
'WriteVersionInfoToBuildLog',
'XamlPreCompile',
'ZipPublishDir',
],
TargetResults: [],
},
)
})
})
})

0 comments on commit 2d60fff

Please sign in to comment.