Skip to content

Commit

Permalink
test(dotnet/NugetRegistryInfo): add tests for NRIOptsBase, `getGith…
Browse files Browse the repository at this point in the history
…ubOutput`, `getGithubOutputSync`
  • Loading branch information
BinToss committed Jan 3, 2025
1 parent fdc0190 commit 918a194
Showing 1 changed file with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions tests/dotnet/NugetRegistryInfo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import { MSBuildProject } from '@halospv3/hce.shared-config/dotnet/MSBuildProjec
import {
NugetRegistryInfo as NRI,
NugetRegistryInfoOptions as NRIOpts,
NugetRegistryInfoOptionsBase as NRIOptsBase,
getGithubOutput,
getGithubOutputSync,
} from '@halospv3/hce.shared-config/dotnet/NugetRegistryInfo'
import { resolve } from 'node:path'
import { isConstructor } from '@halospv3/hce.shared-config/utils/reflection'
Expand All @@ -22,6 +25,7 @@ await describe('NugetRegistryInfo', async (ctx0) => {
deepStrictEqual(NRI.name, ctx0.name)
})

// memory leak...but why?
await describe('an instance of NugetRegistryInfo...', async () => {
const predefinedToken = getEnvVarValue('NUGET_TOKEN')
const { DeterministicNupkgCsproj } = await import('./MSBuildProject.projects.js')
Expand Down Expand Up @@ -112,3 +116,80 @@ await describe('NugetRegistryInfo', async (ctx0) => {
await todo('is a string')
})
})

await describe('NRIOptsBase', async () => {
await it('has expected props', async () => {
strictEqual(
JSON.stringify(NRIOptsBase.props, undefined, 2),
`[
{
"key": "project",
"value": "$ark.MSBuildProject"
},
{
"key": "tokenEnvVars",
"value": {
"sequence": "string",
"proto": "Array"
}
},
{
"key": "url",
"value": "string"
}
]`,
)
})
await it('has expected props (In)', async () => {
strictEqual(
JSON.stringify(NRIOptsBase.in.props, undefined, 2),
`[
{
"key": "project",
"value": "$ark.MSBuildProject"
},
{
"key": "tokenEnvVars",
"value": {
"sequence": "string",
"proto": "Array"
}
},
{
"key": "url",
"value": "string"
}
]`,
)
})
await it('has expected props (Out)', async () => {
strictEqual(
JSON.stringify(NRIOptsBase.out.props, undefined, 2),
`[
{
"key": "project",
"value": "$ark.MSBuildProject"
},
{
"key": "tokenEnvVars",
"value": {
"sequence": "string",
"proto": "Array"
}
},
{
"key": "url",
"value": "string"
}
]`,
)
})
})

await describe('getGithubOutput', async (ctx0) => {
await it('has expected name', () => strictEqual(getGithubOutput.name, ctx0.name))
})

await describe('getGithubOutputSync', async (ctx0) => {
await it('has expected name', () => strictEqual(getGithubOutputSync.name, ctx0.name))
})

0 comments on commit 918a194

Please sign in to comment.