17 lines
599 B
JavaScript
17 lines
599 B
JavaScript
'use strict';
|
|
|
|
const assert = require('assert');
|
|
const nativeImage = require('electron').nativeImage;
|
|
const path = require('path');
|
|
|
|
describe('nativeImage module', () => {
|
|
describe('createFromPath(path)', () => {
|
|
it('normalizes the path', () => {
|
|
const nonAbsolutePath = `${path.join(__dirname, 'fixtures', 'api')}${path.sep}..${path.sep}${path.join('assets', 'logo.png')}`;
|
|
const image = nativeImage.createFromPath(nonAbsolutePath);
|
|
assert(!image.isEmpty());
|
|
assert.equal(image.getSize().height, 190);
|
|
assert.equal(image.getSize().width, 538);
|
|
});
|
|
});
|
|
});
|