Fix test for non darwin platforms

This commit is contained in:
Jia Hao 2016-01-28 23:10:15 +08:00
parent 288f80301c
commit 30fd51fc85
1 changed files with 12 additions and 9 deletions

View File

@ -12,10 +12,6 @@ let assert = chai.assert;
// Prerequisite for test: to use OSX with sips, iconutil and imagemagick convert
function testConvertPng(pngName, done) {
if (os.platform() !== 'darwin') {
console.warn('Skipping png conversion tests, OSX is required');
done();
}
pngToIcns(path.join(__dirname, '../../', 'test-resources', pngName), (error, icnsPath) => {
if (error) {
done(error);
@ -29,11 +25,18 @@ function testConvertPng(pngName, done) {
}
describe('Get Icon Module', function() {
it('Can convert a rgb png to icns', function(done) {
testConvertPng('iconSample.png', done);
});
it('Can convert icons', function() {
if (os.platform() !== 'darwin') {
console.warn('Skipping png conversion tests, OSX is required');
return;
}
it('Can convert a grey png to icns', function(done) {
testConvertPng('iconSampleGrey.png', done);
it('Can convert a rgb png to icns', function(done) {
testConvertPng('iconSample.png', done);
});
it('Can convert a grey png to icns', function(done) {
testConvertPng('iconSampleGrey.png', done);
});
});
});