handle undefined case in BuildService#getBuildMessage
This commit is contained in:
parent
484ecd961e
commit
57beee6c69
2 changed files with 3 additions and 1 deletions
|
@ -33,10 +33,11 @@ describe("BuildServiceImpl", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("getBuildMessage", () => {
|
describe("getBuildMessage", () => {
|
||||||
var buildMessages: {phase: string, message: string}[];
|
var buildMessages: {phase?: string, message: string}[];
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
buildMessages = [
|
buildMessages = [
|
||||||
|
{message: ""},
|
||||||
{phase: null, message: ""},
|
{phase: null, message: ""},
|
||||||
{phase: 'cannot_load', message: 'Cannot load build status'},
|
{phase: 'cannot_load', message: 'Cannot load build status'},
|
||||||
{phase: 'starting', message: 'Starting Dockerfile build'},
|
{phase: 'starting', message: 'Starting Dockerfile build'},
|
||||||
|
|
|
@ -15,6 +15,7 @@ export class BuildServiceImpl implements BuildService {
|
||||||
var message: string;
|
var message: string;
|
||||||
switch (phase) {
|
switch (phase) {
|
||||||
case null:
|
case null:
|
||||||
|
case undefined:
|
||||||
message = '';
|
message = '';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Reference in a new issue