mjackson/expect

toInclude doesn't work with Map object

Open

#176 ouverte le 3 déc. 2016

Voir sur GitHub
 (6 commentaires) (0 réactions) (0 assignés)JavaScript (132 forks)batch import
enhancementhelp wantedquestion

Métriques du dépôt

Stars
 (2 290 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

Example:

it('toInclude should work for Maps', () => {
  const obj = { a: 'a', b: 'b', c: 'c' };
  const map = new Map();
  Object.keys(obj).forEach(k => {
    map.set(k, obj[k]);
  });
  expect(map).toInclude({ b: 'b' });
});

Error: Expected Map (3) {'a' => 'a', 'b' => 'b', 'c' => 'c'} to include { b: 'b' }

Guide contributeur