Light refactoring of the nativeImage module tests
This commit is contained in:
parent
91e4193622
commit
c0c983d28d
1 changed files with 5 additions and 2 deletions
|
@ -181,6 +181,7 @@ describe('nativeImage module', () => {
|
|||
expect(imageFromDataUrl.getSize()).to.deep.equal(imageFromPath.getSize())
|
||||
expect(imageFromDataUrl.toBitmap()).to.satisfy(
|
||||
bitmap => imageFromPath.toBitmap().equals(bitmap))
|
||||
expect(imageFromDataUrl.toDataURL()).to.equal(imageFromPath.toDataURL())
|
||||
}
|
||||
})
|
||||
})
|
||||
|
@ -191,8 +192,10 @@ describe('nativeImage module', () => {
|
|||
for (const imageData of imagesData) {
|
||||
const imageFromPath = nativeImage.createFromPath(imageData.path)
|
||||
|
||||
expect(imageFromPath.toDataURL()).to.equal(imageData.dataUrl)
|
||||
expect(imageFromPath.toDataURL({scaleFactor: 2.0})).to.equal(imageData.dataUrl)
|
||||
const scaleFactors = [1.0, 2.0]
|
||||
for (const scaleFactor of scaleFactors) {
|
||||
expect(imageFromPath.toDataURL({scaleFactor})).to.equal(imageData.dataUrl)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue