MagicTheGathering / mtg-sdk-javascript

Magic: The Gathering SDK - Javascript
MIT License
283 stars 60 forks source link

broken test on master branch: card > find > returns card #65

Closed manuartero closed 5 months ago

manuartero commented 5 months ago

desc

running npm test from fresh start doesn't work.

steps

  1. git clone ✅
  2. npm i && npm test ✅
  3. broken test 🔴

npm test output:

 10 passing (37s)
  1 failing

  1) card
       find
         returns card:

      AssertionError: expected { Object (name, manaCost, ...) } to have nested property 'colors[0]' of 'Black', but got 'B'
      + expected - actual

      -B
      +Black

      at Context.<anonymous> (src/test/test-card.js:16:38)

quick fix

      result.card.should.have.property('type', 'Sorcery — Arcane')
-     result.card.should.have.nested.property('colors[0]', 'Black')
+     result.card.should.have.nested.property('colors[0]', 'B')
      result.card.should.have.nested.property('types[0]', 'Sorcery')
raineorshine commented 5 months ago

Thanks! Looks like the underlying API changed at some point. I've updated the test.