mjackson/expect

toInclude doesn't work with Map object

Ouverte

#176 ouverte le 3 déc. 2016

 (6 commentaires) (0 réaction) (0 personne assignée)JavaScript (115 forks)batch import
enhancementhelp wantedquestion

Métriques du dépôt

Stars
 (2 269 étoiles)
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