mjackson/expect

toInclude doesn't work with Map object

Open

#176 geöffnet am 3. Dez. 2016

Auf GitHub ansehen
 (6 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (132 Forks)batch import
enhancementhelp wantedquestion

Repository-Metriken

Stars
 (2.290 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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

Contributor Guide