react-notification
Advanced tools
Comparing version 6.7.0 to 6.7.1
@@ -27,3 +27,3 @@ 'use strict'; | ||
isActive: _propTypes2.default.bool, | ||
title: _propTypes2.default.string | ||
title: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.node]) | ||
}; |
@@ -65,1 +65,8 @@ ## Introduction | ||
``` | ||
## Sponsor | ||
**Individual**: If you like this code and you're interested in buying me a drink, I have a [Gratipay](https://gratipay.com/~pburtchaell/) (recurring) or [Venmo](https://venmo.com/pburtchaell) (one time). I greatly appreciate your support and I'm grateful to be a part of the open source and GitHub communities. | ||
**Company**: To help cover the cost of my time spent maintaining open source software projects, I'm looking for a small sponsor. If your company is interested, [email me](mailto:patrick@pburtchaell.com) and we can chat! | ||
@@ -34,3 +34,6 @@ var fs = require('fs'); | ||
plugins: [ | ||
new webpack.optimize.CommonsChunkPlugin('shared.js'), | ||
new webpack.optimize.CommonsChunkPlugin({ | ||
name: 'shared', | ||
filename: 'shared.js', | ||
}), | ||
new webpack.DefinePlugin({ | ||
@@ -42,7 +45,9 @@ 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development') | ||
module: { | ||
loaders: [ | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
loader: 'babel', | ||
use: { | ||
loader: 'babel-loader' | ||
} | ||
} | ||
@@ -49,0 +54,0 @@ ] |
{ | ||
"name": "react-notification", | ||
"version": "6.7.0", | ||
"version": "6.7.1", | ||
"description": "Snackbar style notification component for React", | ||
@@ -10,6 +10,6 @@ "main": "dist/index.js", | ||
"prebuild": "npm test", | ||
"build": "`npm bin`/babel src -d dist", | ||
"build": "node_modules/.bin/babel src -d dist", | ||
"pretest": "npm run lint", | ||
"test": "./bin/test.sh", | ||
"lint": "`npm bin`/eslint src/**/*.js test/**/*.js", | ||
"lint": "node_modules/.bin/eslint src/**/*.js test/**/*.js", | ||
"start": "node examples/server.js" | ||
@@ -46,3 +46,3 @@ }, | ||
"babel-cli": "^6.24.1", | ||
"babel-core": "^6.24.1", | ||
"babel-core": "^6.25.0", | ||
"babel-eslint": "^7.2.2", | ||
@@ -63,21 +63,21 @@ "babel-loader": "^6.4.1", | ||
"eslint-plugin-react": "^6.7.1", | ||
"express": "^4.15.2", | ||
"express": "^4.15.3", | ||
"express-urlrewrite": "^1.2.0", | ||
"html-webpack-plugin": "^2.28.0", | ||
"immutable": "^3.8.1", | ||
"jsdom": "^9.12.0", | ||
"mocha": "^3.2.0", | ||
"jsdom": "^11.0.0", | ||
"mocha": "^3.4.2", | ||
"pre-commit": "^1.2.2", | ||
"react": "^15.5.4", | ||
"react-addons-test-utils": "^15.5.1", | ||
"react-dom": "^15.5.4", | ||
"react-test-renderer": "^15.5.4", | ||
"sinon": "^1.17.3", | ||
"webpack": "^1.12.14", | ||
"webpack-dev-middleware": "^1.10.1", | ||
"webpack-dev-server": "^1.14.1" | ||
"react": "^15.6.1", | ||
"react-addons-test-utils": "^15.6.0", | ||
"react-dom": "^15.6.1", | ||
"react-test-renderer": "^15.6.1", | ||
"sinon": "^2.2.0", | ||
"webpack": "^2.6.1", | ||
"webpack-dev-middleware": "^1.10.2", | ||
"webpack-dev-server": "^2.4.5" | ||
}, | ||
"dependencies": { | ||
"prop-types": "^15.5.8" | ||
"prop-types": "^15.5.10" | ||
} | ||
} |
@@ -17,7 +17,3 @@ # React Notification | ||
## Sponsor | ||
To help cover the cost of my time spent maintaining open source software (OSS) projects, **I'm looking for a small sponsor.** If your company is interested, [send me an email](mailto:patrick@pburtchaell.com) and we can chat! If you like my code and you're interested in buying me a drink, I have a [Gratipay](https://gratipay.com/~pburtchaell/). Thanks! I greatly appreciate your support and I'm grateful to be a part of the OSS and GitHub community. | ||
--- | ||
Copyright (c) 2015 Patrick Burtchaell. [Licensed with The MIT License (MIT)](https://raw.githubusercontent.com/pburtchaell/react-notification/master/LICENSE). [Gratipay](https://gratipay.com/~pburtchaell/). |
import React from 'react'; | ||
import sinon from 'sinon'; | ||
import { Notification } from '../src/index'; | ||
@@ -31,2 +32,35 @@ import mockNotification from './mockNotification'; | ||
describe('title as React.PropTypes.node', () => { | ||
before(() => { | ||
// Since react will console.error propType warnings, | ||
// we stub console.error to raise an error | ||
// so the test runner will pick it up. | ||
sinon.stub(console, 'error').callsFake((warning) => { | ||
throw new Error(warning); | ||
}); | ||
}); | ||
after(() => { | ||
/* eslint-disable no-console */ | ||
console.error.restore(); | ||
/* eslint-enable no-console */ | ||
}); | ||
it('renders without error', () => { | ||
const icon = <i aria-hidden="true" className="warning" />; | ||
shallow( | ||
<Notification | ||
message={mockNotification.message} | ||
action={mockNotification.action} | ||
barStyle={mockNotification.barStyle} | ||
actionStyle={mockNotification.actionStyle} | ||
activeBarStyle={mockNotification.activeBarStyle} | ||
onClick={mockNotification.onClick} | ||
dismissAfter={mockNotification.dismissAfter} | ||
title={icon} | ||
/> | ||
); | ||
}); | ||
}); | ||
it('has the className `notification-bar`', () => { | ||
@@ -33,0 +67,0 @@ expect(component).to.have.className('notification-bar'); |
@@ -0,1 +1,2 @@ | ||
import jsdom, { JSDOM } from 'jsdom'; | ||
import chai from 'chai'; | ||
@@ -18,10 +19,14 @@ import chaiEnzyme from 'chai-enzyme'; | ||
global.mount = require('enzyme').mount; | ||
global.jsdom = require('jsdom').jsdom; | ||
global.document = jsdom(''); | ||
global.window = document.defaultView; | ||
Object.keys(document.defaultView).forEach((property) => { | ||
global.jsdom = jsdom; | ||
const dom = new JSDOM(); | ||
global.document = dom.document; | ||
global.window = dom.window; | ||
Object.keys(dom.window).forEach((property) => { | ||
if (typeof global[property] === 'undefined') { | ||
exposedProperties.push(property); | ||
global[property] = document.defaultView[property]; | ||
global[property] = dom.window[property]; | ||
} | ||
@@ -28,0 +33,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
554390
1171
19
Updatedprop-types@^15.5.10