Skip to content

Commit

Permalink
0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
hanzhangyu committed Sep 3, 2017
1 parent 22061cf commit 2fe4c73
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 23 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Expand Up @@ -3,6 +3,9 @@
"plugins": ["transform-es3-member-expression-literals", "transform-es3-property-literals", "transform-class-properties"],
"env": {
"development": {
},
"test": {
"plugins": [ "istanbul" ]
}
}
}
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -3,3 +3,4 @@ coverage
.coveralls.yml
npm-debug.*
.idea
.nyc_output
5 changes: 4 additions & 1 deletion README.md
Expand Up @@ -3,7 +3,10 @@

Create a `iframe` or `new window` to print a part of page what you want. Considering the [a-x-/react-easy-print](https://github.com/a-x-/react-easy-print) if you don`t like to use these two methods

> travis is coming soon
[![NPM version](https://img.shields.io/npm/v/rc-print.svg?style=flat)](https://npmjs.org/package/rc-print)
[![Build Status](https://www.travis-ci.org/hanzhangyu/rc-print.svg?branch=master)](https://www.travis-ci.org/hanzhangyu/rc-print)
[![Coverage Status](https://coveralls.io/repos/github/hanzhangyu/rc-print/badge.svg?branch=master)](https://coveralls.io/github/hanzhangyu/rc-print?branch=master)
[![NPM downloads](http://img.shields.io/npm/dm/rc-print.svg?style=flat)](https://npmjs.org/package/rc-print)

[中文前看这里](./README_zh-CN.md)

Expand Down
22 changes: 18 additions & 4 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "rc-print",
"version": "0.1.0",
"version": "0.1.1",
"description": "Create a iframe or new window to print easily",
"repository": {
"type": "git",
Expand All @@ -16,13 +16,13 @@
"license": "MIT",
"main": "lib/index.js",
"scripts": {
"test": "mocha test/.setup.js test/**/*-test.js",
"test": "cross-env NODE_ENV=test nyc mocha",
"build": "rimraf lib && babel src --out-dir lib && npm run demo",
"demo": "webpack",
"dev": "webpack --watch",
"prepublish": "npm run build",
"start": "webpack-dev-server --watch",
"coveralls": "coveralls"
"coveralls": "nyc report --reporter=text-lcov | coveralls"
},
"dependencies": {
"babel-runtime": "^6.11.6"
Expand All @@ -33,6 +33,7 @@
"babel-eslint": "^7.2.3",
"babel-jest": "^20.0.3",
"babel-loader": "^6.2.0",
"babel-plugin-istanbul": "^4.1.4",
"babel-plugin-transform-class-properties": "*",
"babel-plugin-transform-es3-member-expression-literals": "*",
"babel-plugin-transform-es3-property-literals": "*",
Expand All @@ -41,6 +42,7 @@
"babel-preset-react-hmre": "^1.1.1",
"babel-preset-stage-0": "^6.24.1",
"coveralls": "^2.13.1",
"cross-env": "^5.0.5",
"css-loader": "~0.16.0",
"enzyme": "^2.8.2",
"eslint": "^3.19.0",
Expand All @@ -55,6 +57,7 @@
"jsx-loader": "~0.13.2",
"jsdom": "^9.6.0",
"mocha": "^3.0.2",
"nyc": "^11.1.0",
"prop-types": "^15.0.0",
"react": "^15.5.0",
"react-dom": "^15.5.0",
Expand All @@ -71,5 +74,16 @@
"files": [
"lib",
"src"
]
],
"nyc": {
"include": [
"src/**/*.js"
],
"require": [
"babel-register",
"./test/.setup.js"
],
"sourceMap": false,
"instrument": false
}
}
21 changes: 3 additions & 18 deletions test/.setup.js
@@ -1,20 +1,5 @@
require('babel-register')();
import { jsdom } from 'jsdom';

var jsdom = require('jsdom').jsdom;

var exposedProperties = ['window', 'navigator', 'document'];

global.document = jsdom('');
global.document = jsdom('<!doctype html><html><body><div id="root"></div></body></html>', { url: 'http://localhost' });
global.window = document.defaultView;
Object.keys(document.defaultView).forEach((property) => {
if (typeof global[property] === 'undefined') {
exposedProperties.push(property);
global[property] = document.defaultView[property];
}
});

global.navigator = {
userAgent: 'node.js'
};

documentRef = document;
global.navigator = global.window.navigator;

0 comments on commit 2fe4c73

Please sign in to comment.