just initialize it inline:
var testResult = {
  type: 'result',
  ...
}