diff --git a/spec/api-native-image-spec.js b/spec/api-native-image-spec.js index de96217dd1d..3ee5e55c25c 100644 --- a/spec/api-native-image-spec.js +++ b/spec/api-native-image-spec.js @@ -146,4 +146,11 @@ describe('nativeImage module', () => { 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) + }) + }) })