diff --git a/test/test.cloudly.ts b/test/test.cloudly.ts new file mode 100644 index 0000000..feac4fc --- /dev/null +++ b/test/test.cloudly.ts @@ -0,0 +1,16 @@ +process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = '0'; +import { tap, expect } from '@pushrocks/tapbundle'; + +import * as cloudlyConnectorMod from '../ts/connector.cloudly/cloudlyconnector'; + +tap.test('should be able to announce a container to cloudly', async () => { + const cloudlyConnector = new cloudlyConnectorMod.CloudlyConnector(null); + await cloudlyConnector.announceDockerContainer({ + registryUrl: 'registry.losssless.com', + tag: 'testcontainer', + version: 'x.x.x', + labels: [] + }, 'cloudly.lossless.one') +}); + +tap.start(); \ No newline at end of file diff --git a/ts/connector.cloudly/cloudlyconnector.ts b/ts/connector.cloudly/cloudlyconnector.ts index 760b8b7..5753830 100644 --- a/ts/connector.cloudly/cloudlyconnector.ts +++ b/ts/connector.cloudly/cloudlyconnector.ts @@ -14,9 +14,10 @@ export class CloudlyConnector { } public async announceDockerContainer( - optionsArg: plugins.tsclass.container.IContainer + optionsArg: plugins.tsclass.container.IContainer, + testCloudlyUrlArg?: string ) { - const cloudlyUrl = this.npmciRef.npmciConfig.getConfig().urlCloudly; + const cloudlyUrl = testCloudlyUrlArg || this.npmciRef.npmciConfig.getConfig().urlCloudly; if (!cloudlyUrl) { logger.log( 'warn',