提交 9395a3c6 编写于 作者: H higashi

Add some test cases

上级 c164870b
......@@ -62,17 +62,6 @@ describe('DokcerImageReference', () => {
expect(result).toEqual('1');
});
it('should return part of the string after `:` delimiter', () => {
// given
let reference = 'test:1';
// when
let result = new DockerImageReference(reference).tag();
// then
expect(result).toEqual('1');
});
it('should return part of the string after `:` delimiter', () => {
// given
let reference = 'private.registry:5000/test:1';
......@@ -157,4 +146,38 @@ describe('DokcerImageReference', () => {
// then
expect(result).toEqual('');
});
it('should retrun empty when containerImage is `::`', () => {
// given
let reference = '::';
// when
let result = new DockerImageReference(reference).tag();
// then
expect(result).toEqual('');
});
it('should retrun empty when containerImage is not empty and ends with `:` delimiter', () => {
// given
let reference = "test:";
// when
let result = new DockerImageReference(reference).tag();
// then
expect(result).toEqual('');
});
it('should retrun empty when containerImage is not empty and ends with `/` delimiter', () => {
// given
let reference = "test/";
// when
let result = new DockerImageReference(reference).tag();
// then
expect(result).toEqual('');
});
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册