Skip to content

Commit

Permalink
Add simple unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
HazAT committed Apr 11, 2024
1 parent 12905f5 commit c06bd75
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/targets/__tests__/registry.test.ts
Original file line number Diff line number Diff line change
@@ -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');
});
});

0 comments on commit c06bd75

Please sign in to comment.