Skip to content

Question: testing and covering shapes with jest  #78

@ChriBack

Description

@ChriBack

Hi,

I am new to vue-types and developing in a project with testing and code coverage with jest.
My problem ist, that jest/istanbul is telling me that "function not covered" when it comes to shapes.

image
In the image you can see the problem.
the vue component looks like this

import VueTypes from 'vue-types';
import { contractStatus } from '@/global-js/mappings';

export default {
  name: 'BankAccountEditListContractStatus',

  props: {
    status: VueTypes.shape({
      color: VueTypes.oneOf(Object.keys(contractStatus)).isRequired,
      tooltip: VueTypes.string,
    }).def(() => ({ tooltip: '' })),
    power: VueTypes.string.isRequired,
    tooltipPrice: VueTypes.string.def(''),
  },

  computed: {
    statusClass() {
      return `is-${contractStatus[this.status.farbe].color}`;
    },
  },
}

Any thoughts on how i can cover this?

Thank you in advance

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions