Launch Week Day 2: Introducing Reports: An Extensible Reporting Framework for Socket Data.Learn More
Socket
Book a DemoSign in
Socket

node-notifier

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-notifier - npm Package Compare versions

Comparing version
3.0.1
to
3.0.2
+66
test/utils.js
var should = require('should')
, cp = require('child_process')
, assert = require('assert');
var _ = require('../lib/utils');
var originalPlatform = process.platform;
var originalVersion = _.getOSXVersion;
describe('utils', function(){
before(function () {
process.platform = "darwin";
});
after(function () {
process.platform = originalPlatform;
_.getOSXVersion = originalVersion;
});
it('should support mac 10.8', function (done) {
_.getOSXVersion = function (cb) {
cb(null, "10.8", "");
};
_.isMacOSX(function (error, msg) {
error.should.be.false;
done();
});
});
it('should support not mac 10.7', function (done) {
_.getOSXVersion = function (cb) {
cb(null, "10.7", "");
};
_.isMacOSX(function (error, msg) {
error.should.be.true;
done();
});
});
it('should support 10.10', function (done) {
_.getOSXVersion = function (cb) {
cb(null, "10.10", "");
};
_.isMacOSX(function (error, msg) {
error.should.be.false;
done();
});
});
it('should sopport 10.10 with newline', function (done) {
_.getOSXVersion = function (cb) {
cb(null, "10.10\n", "");
};
_.isMacOSX(function (error, msg) {
error.should.be.false;
done();
});
});
});
+7
-5

@@ -1,3 +0,2 @@

var child_process = require('child_process')
, exec = child_process.exec
var cp = require('child_process')
, osVersionError = 'Incorrect OS. node-notify requires Mac OS 10.8 or higher'

@@ -51,2 +50,6 @@ , shellwords = require('shellwords');

module.exports.getOSXVersion = function (cb) {
return cp.exec("sw_vers -productVersion", cb);
}
module.exports.isMacOSX = function (cb) {

@@ -56,8 +59,7 @@ if (process.platform != 'darwin') {

}
return exec("sw_vers -productVersion", function (error, stdout, stderr) {
return module.exports.getOSXVersion(function (error, stdout, stderr) {
if (error) {
return cb(true, error, stderr);
}
if (stdout.split(".")[1] >= "8") {
if (Number(stdout.split(".")[1]) >= 8) {
return cb(false);

@@ -64,0 +66,0 @@ }

{
"name": "node-notifier",
"version": "3.0.1",
"version": "3.0.2",
"description": "A Node.js module for sending notifications on mac, windows and linux",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -186,2 +186,5 @@ # node-notifier [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url]

### `v3.0.1`
1. Fixes version check for Mac OS X Yosemite
### `v3.0.0`

@@ -188,0 +191,0 @@ 1. Updates terminal-notifier to version 1.6.0; adding support for appIcon and contentImage

@@ -10,2 +10,4 @@ var NotificationCenter = require('../').NotificationCenter

var originalUtils = utils.command;
var originalIsMacOsX = utils.isMacOSX;
var originalType = os.type;

@@ -24,4 +26,9 @@ (function () {

};
})
});
after(function () {
os.type = originalType;
utils.isMacOSX = originalIsMacOsX;
});
describe('#notify()', function(){

@@ -28,0 +35,0 @@