diff --git a/src/targets/__tests__/registry.test.ts b/src/targets/__tests__/registry.test.ts new file mode 100644 index 00000000..7824ce6e --- /dev/null +++ b/src/targets/__tests__/registry.test.ts @@ -0,0 +1,35 @@ +import { RegistryConfig, RegistryTarget } from '../registry'; +import { NoneArtifactProvider } from '../../artifact_providers/none'; +import { RegistryPackageType } from '../../utils/registry'; + +describe('getUpdatedManifest', () => { + const target = new RegistryTarget( + { name: 'pypi' }, + new NoneArtifactProvider(), + { owner: 'testSourceOwner', repo: 'testSourceRepo' } + ); + + it('check if createdAt exists', async () => { + const registryConfig: RegistryConfig = { + type: RegistryPackageType.SDK, + canonicalName: 'example-package', + }; + const packageManifest = { + canonical: 'example-package', + }; + const canonical = 'example-package'; + const version = '1.2.3'; + const revision = 'abc123'; + + const updatedManifest = await target.getUpdatedManifest( + registryConfig, + packageManifest, + canonical, + version, + revision + ); + + // check if property createdAt exists + expect(updatedManifest).toHaveProperty('createdAt'); + }); +});