Browse Source

:art: Use deepEqual asserts

Kevin Sawicki 8 years ago
parent
commit
6aba4e916a
1 changed files with 4 additions and 8 deletions
  1. 4 8
      spec/api-native-image-spec.js

+ 4 - 8
spec/api-native-image-spec.js

@@ -18,24 +18,21 @@ describe('nativeImage module', () => {
       const imagePath = `.${path.sep}${path.join('spec', 'fixtures', 'assets', 'logo.png')}`
       const image = nativeImage.createFromPath(imagePath)
       assert(!image.isEmpty())
-      assert.equal(image.getSize().height, 190)
-      assert.equal(image.getSize().width, 538)
+      assert.deepEqual(image.getSize(), {width: 538, height: 190})
     })
 
     it('loads images from paths with `.` segments', () => {
       const imagePath = `${path.join(__dirname, 'fixtures')}${path.sep}.${path.sep}${path.join('assets', 'logo.png')}`
       const image = nativeImage.createFromPath(imagePath)
       assert(!image.isEmpty())
-      assert.equal(image.getSize().height, 190)
-      assert.equal(image.getSize().width, 538)
+      assert.deepEqual(image.getSize(), {width: 538, height: 190})
     })
 
     it('loads images from paths with `..` segments', () => {
       const imagePath = `${path.join(__dirname, 'fixtures', 'api')}${path.sep}..${path.sep}${path.join('assets', 'logo.png')}`
       const image = nativeImage.createFromPath(imagePath)
       assert(!image.isEmpty())
-      assert.equal(image.getSize().height, 190)
-      assert.equal(image.getSize().width, 538)
+      assert.deepEqual(image.getSize(), {width: 538, height: 190})
     })
 
     it('Gets an NSImage pointer on macOS', () => {
@@ -57,8 +54,7 @@ describe('nativeImage module', () => {
       const imagePath = path.join(__dirname, 'fixtures', 'assets', 'icon.ico')
       const image = nativeImage.createFromPath(imagePath)
       assert(!image.isEmpty())
-      assert.equal(image.getSize().height, 256)
-      assert.equal(image.getSize().width, 256)
+      assert.deepEqual(image.getSize(), {width: 256, height: 256})
     })
   })