Last active
September 14, 2017 06:37
-
-
Save zgababa/64b4f5186e6a5b57e4d2a5d9375e3d71 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const graphql = require('graphql'); | |
const chai = require('chai'); | |
const pokemon = require('./pokemon'); | |
const pokemonType = pokemon.type; | |
const expect = chai.expect; | |
describe('Pokemon', () => { | |
it('Should resolve orderFormatted field', () => { | |
expect(pokemonType.getFields().orderFormatted.resolve({ order : 1 })).to.equal('# 1'); | |
}); | |
it('Should return empty string if no order provided', () => { | |
expect(pokemonType.getFields().orderFormatted.resolve()).to.equal(''); | |
}); | |
it('Should resolve img field', () => { | |
expect(pokemonType.getFields().img.resolve({ sprites : { front_default : 'default' } })).to.equal('default'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment