mjackson/expect

toInclude doesn't work with Map object

Open

#176 aperta il 3 dic 2016

Vedi su GitHub
 (6 commenti) (0 reazioni) (0 assegnatari)JavaScript (132 fork)batch import
enhancementhelp wantedquestion

Metriche repository

Star
 (2290 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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' }

Guida contributor