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", () => {
|
||||
var buildMessages: {phase: string, message: string}[];
|
||||
var buildMessages: {phase?: string, message: string}[];
|
||||
|
||||
beforeEach(() => {
|
||||
buildMessages = [
|
||||
{message: ""},
|
||||
{phase: null, message: ""},
|
||||
{phase: 'cannot_load', message: 'Cannot load build status'},
|
||||
{phase: 'starting', message: 'Starting Dockerfile build'},
|
||||
|
|
|
@ -15,6 +15,7 @@ export class BuildServiceImpl implements BuildService {
|
|||
var message: string;
|
||||
switch (phase) {
|
||||
case null:
|
||||
case undefined:
|
||||
message = '';
|
||||
break;
|
||||
|
||||
|
|
Reference in a new issue