🎨 Use deepEqual asserts
This commit is contained in:
parent
6a7f0d70fd
commit
6aba4e916a
1 changed files with 4 additions and 8 deletions
|
@ -18,24 +18,21 @@ describe('nativeImage module', () => {
|
||||||
const imagePath = `.${path.sep}${path.join('spec', 'fixtures', 'assets', 'logo.png')}`
|
const imagePath = `.${path.sep}${path.join('spec', 'fixtures', 'assets', 'logo.png')}`
|
||||||
const image = nativeImage.createFromPath(imagePath)
|
const image = nativeImage.createFromPath(imagePath)
|
||||||
assert(!image.isEmpty())
|
assert(!image.isEmpty())
|
||||||
assert.equal(image.getSize().height, 190)
|
assert.deepEqual(image.getSize(), {width: 538, height: 190})
|
||||||
assert.equal(image.getSize().width, 538)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it('loads images from paths with `.` segments', () => {
|
it('loads images from paths with `.` segments', () => {
|
||||||
const imagePath = `${path.join(__dirname, 'fixtures')}${path.sep}.${path.sep}${path.join('assets', 'logo.png')}`
|
const imagePath = `${path.join(__dirname, 'fixtures')}${path.sep}.${path.sep}${path.join('assets', 'logo.png')}`
|
||||||
const image = nativeImage.createFromPath(imagePath)
|
const image = nativeImage.createFromPath(imagePath)
|
||||||
assert(!image.isEmpty())
|
assert(!image.isEmpty())
|
||||||
assert.equal(image.getSize().height, 190)
|
assert.deepEqual(image.getSize(), {width: 538, height: 190})
|
||||||
assert.equal(image.getSize().width, 538)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it('loads images from paths with `..` segments', () => {
|
it('loads images from paths with `..` segments', () => {
|
||||||
const imagePath = `${path.join(__dirname, 'fixtures', 'api')}${path.sep}..${path.sep}${path.join('assets', 'logo.png')}`
|
const imagePath = `${path.join(__dirname, 'fixtures', 'api')}${path.sep}..${path.sep}${path.join('assets', 'logo.png')}`
|
||||||
const image = nativeImage.createFromPath(imagePath)
|
const image = nativeImage.createFromPath(imagePath)
|
||||||
assert(!image.isEmpty())
|
assert(!image.isEmpty())
|
||||||
assert.equal(image.getSize().height, 190)
|
assert.deepEqual(image.getSize(), {width: 538, height: 190})
|
||||||
assert.equal(image.getSize().width, 538)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Gets an NSImage pointer on macOS', () => {
|
it('Gets an NSImage pointer on macOS', () => {
|
||||||
|
@ -57,8 +54,7 @@ describe('nativeImage module', () => {
|
||||||
const imagePath = path.join(__dirname, 'fixtures', 'assets', 'icon.ico')
|
const imagePath = path.join(__dirname, 'fixtures', 'assets', 'icon.ico')
|
||||||
const image = nativeImage.createFromPath(imagePath)
|
const image = nativeImage.createFromPath(imagePath)
|
||||||
assert(!image.isEmpty())
|
assert(!image.isEmpty())
|
||||||
assert.equal(image.getSize().height, 256)
|
assert.deepEqual(image.getSize(), {width: 256, height: 256})
|
||||||
assert.equal(image.getSize().width, 256)
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue