Add spec for getAspectRatio
This commit is contained in:
parent
abffd98e29
commit
4ffae1d563
1 changed files with 7 additions and 0 deletions
|
@ -146,4 +146,11 @@ describe('nativeImage module', () => {
|
||||||
assert(!cropA.toPNG().equals(cropB.toPNG()))
|
assert(!cropA.toPNG().equals(cropB.toPNG()))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('getAspectRatio()', () => {
|
||||||
|
it('returns the aspect ratio of the image', () => {
|
||||||
|
assert.equal(nativeImage.createEmpty().getAspectRatio(), 1.0)
|
||||||
|
assert.equal(nativeImage.createFromPath(path.join(__dirname, 'fixtures', 'assets', 'logo.png')).getAspectRatio(), 2.8315789699554443)
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue