Skip to content

Commit

Permalink
Merge 0f93af9 into 8cfc843
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammad-naji7 committed Feb 1, 2018
2 parents 8cfc843 + 0f93af9 commit 7ec5b51
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 67 deletions.
57 changes: 24 additions & 33 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,39 +1,30 @@
{
"presets": [
[
"env",
{
"presets": [
["@babel/preset-env", {
"targets": {
"node": "current"
}
}
"browsers": [
">1%",
"last 4 versions",
"Firefox ESR",
"not ie < 9",
"Explorer 11",
]
},
"debug": true,
"useBuiltIns": "usage"
}],
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-proposal-class-properties"
],
"stage-0",
"react"
],
"env": {
"production": {
"plugins": [
"transform-es2015-template-literals",
"transform-runtime",
"babel-plugin-inject"
],
"presets": [
"modern-browsers",
"react-optimize",
"stage-0",
"react"
]
},
"env": {
"test": {
"plugins": [
"istanbul",
"rewire"
],
"presets": [
"stage-0",
"react"
]
"plugins": [
"istanbul"
]
}
}
}
}
2 changes: 1 addition & 1 deletion .nycrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require": [
"babel-register"
"@babel/register"
],
"include": [
"src"
Expand Down
43 changes: 19 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-inline-styler",
"version": "2.0.0",
"version": "2.0.1",
"description": "react inline styles injector",
"main": "./distribution/index.js",
"license": "MIT",
Expand All @@ -27,22 +27,17 @@
"react": "^15.0.0-0 || ^16.0.0-0"
},
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-core": "^6.24.1",
"babel-loader": "^7.0.0",
"babel-plugin-inject": "^0.0.4",
"babel-plugin-istanbul": "^4.1.1",
"babel-plugin-rewire": "^1.1.0",
"babel-plugin-transform-es2015-template-literals": "^6.22.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.4.0",
"babel-preset-es2015": "^6.22.0",
"babel-preset-modern-browsers": "^9.0.2",
"babel-preset-node5": "^11.1.0",
"babel-preset-react": "^6.24.1",
"babel-preset-react-optimize": "^1.0.1",
"babel-preset-stage-0": "^6.5.0",
"babel-register": "^6.24.1",
"@babel/cli": "^7.0.0-beta.39",
"@babel/core": "^7.0.0-beta.39",
"@babel/node": "^7.0.0-beta.39",
"@babel/plugin-proposal-class-properties": "^7.0.0-beta.39",
"@babel/plugin-proposal-export-default-from": "^7.0.0-beta.39",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.39",
"@babel/plugin-transform-arrow-functions": "^7.0.0-beta.39",
"@babel/preset-env": "^7.0.0-beta.39",
"@babel/preset-react": "^7.0.0-beta.39",
"@babel/register": "^7.0.0-beta.39",
"babel-plugin-istanbul": "^4.1.5",
"chai": "^3.5.0",
"chai-enzyme": "^1.0.0-beta.0",
"chai-spies": "^0.7.1",
Expand All @@ -55,7 +50,7 @@
"jsdom": "^9.12.0",
"mkdirp": "^0.5.1",
"mocha": "^3.3.0",
"nyc": "^10.2.0",
"nyc": "^11.3.0",
"object.entries": "^1.0.4",
"react": "^16.2.0",
"react-dom": "^16.0.0",
Expand All @@ -64,15 +59,15 @@
},
"scripts": {
"test": "cross-env NODE_ENV=test mocha",
"test:watch": "yarn run test -- --reporter min --watch",
"test:cover": "cross-env NODE_ENV=test nyc yarn run test",
"test:watch": "npm run test -- --reporter min --watch",
"test:cover": "cross-env NODE_ENV=test nyc npm run test",
"clean": "babel-node tools/run clean",
"build:babel": "cross-env NODE_ENV=production babel src --out-dir distribution --compact=true --no-comments",
"build": "cross-env NODE_ENV=production babel-node tools/run build",
"prepublish": "yarn run build",
"coverage:html": "yarn run test:cover && nyc report --reporter=html",
"coverage:lcov": "yarn run test:cover && nyc report --reporter=lcov",
"coverage": "yarn run coverage:html && open coverage/index.html",
"prepublish": "npm run build",
"coverage:html": "npm run test:cover && nyc report --reporter=html",
"coverage:lcov": "npm run test:cover && nyc report --reporter=lcov",
"coverage": "npm run coverage:html && open coverage/index.html",
"coveralls": "nyc report --reporter=text-lcov | coveralls",
"codecov": "codecov"
}
Expand Down
4 changes: 2 additions & 2 deletions test/core.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ describe('Core', () => {

const emptyPipeline = [];
const emptyConfig = {};
const redToBluePipeline = [redToBlueProcessor];
const useConfigsPipeline = [redToBlueProcessor, addFontSize];
const redToBluePipeline = [redToBlueProcessor];
const useConfigsPipeline = [redToBlueProcessor, addFontSize];
const fontSizeConfigs = {fontSize: 14}

describe('processStyleObject', () => {
Expand Down
10 changes: 5 additions & 5 deletions test/injector.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('Injector HOC', () => {
expect(error).to.not.equal(null);
expect(error.message).to.equal(expectedErrorMessage);
});

it('injects styles prop to wrapped component', () => {
expect(child.props.styles).to.be.an('object');
});
Expand All @@ -80,7 +80,7 @@ describe('Injector HOC', () => {
spy();
return <div style={{color: 'red'}} data-styles={styles} />;
}

const InjectedChild = injectStyles(stylesToInject)(SpiedChild);

const tree = renderIntoDocument(
Expand All @@ -107,7 +107,7 @@ describe('Injector HOC', () => {
return <div style={{color: 'red'}} data-styles={styles} />;
}
const InjectedChild = injectStyles(stylesToInject)(SpiedChild);

const tree = renderIntoDocument(
<ProviderContainer initialConfigs={initialConfigs}>
<InjectedChild />
Expand Down Expand Up @@ -157,7 +157,7 @@ describe('Injector HOC', () => {
const styleToProccess = {color: "red"};
const tree = mountInjector(<InjectedChild style={styleToProccess}/>, [redToBlueProcessor]);
expect(tree).to.have.style("color", "red")

});
})

Expand All @@ -171,7 +171,7 @@ describe('Injector HOC', () => {
return <div style={computedRootStyle} />;
}
const InjectedChild = injectStyles(stylesToInject)(ComputedStylesChild);


it('injects computeStyle helper to wrapped component', () => {
expect(child.props.computeStyle).to.be.a('function');
Expand Down
2 changes: 1 addition & 1 deletion test/mocha.opts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
--compilers js:babel-register
--compilers js:@babel/register
--require ./test/setup
test/**/*.test.js
2 changes: 1 addition & 1 deletion test/setup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require('babel-register')();
require('@babel/register')();
// import 'babel-polyfill';

process.env.NODE_ENV = 'test';
Expand Down

0 comments on commit 7ec5b51

Please sign in to comment.