Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Commit

Permalink
Update Infra #969 - Replace isparta with istanbul
Browse files Browse the repository at this point in the history
  • Loading branch information
blainekasten committed Dec 5, 2018
1 parent c88b0f1 commit eb4ab48
Show file tree
Hide file tree
Showing 38 changed files with 1,329 additions and 587 deletions.
File renamed without changes.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ script:
# Output useful info for debugging.
- node --version
- yarn --version
# Make sure prettier has ran on all files.
- yarn format-check
# Make sure we can actually build the examples.
- yarn run build-examples
# Run tests
Expand Down
27 changes: 17 additions & 10 deletions examples/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ class HoverMessage extends React.Component {
<button key="button" style={{display: 'flex', ':hover': {}}}>
Hover me!
</button>
{getState(this.state, 'button', ':hover')
? <span>{' '}Hovering!</span>
: null}
{getState(this.state, 'button', ':hover') ? (
<span> Hovering!</span>
) : null}
</div>
);
}
Expand All @@ -42,7 +42,8 @@ HoverMessage = Radium(HoverMessage);
//
// Radium with ES7 decorator
//
@Radium class TwoSquares extends React.Component {
@Radium
class TwoSquares extends React.Component {
render() {
return (
<div>
Expand Down Expand Up @@ -120,20 +121,26 @@ class App extends React.Component {
<StyleRoot>
<VisitedLink />

<p /><HoverMessage />
<p />
<HoverMessage />

<p /><TwoSquares />
<p />
<TwoSquares />

<p /><Spinner />
<p />
<Spinner />

<p /><MultiSpinner />
<p />
<MultiSpinner />

<p />
<Button onClick={this._remount.bind(this)}>Unmount and remount</Button>

<p /><Button>Button</Button>
<p />
<Button>Button</Button>

<p /><Button color="red">Button</Button>
<p />
<Button color="red">Button</Button>

<p />
<Button
Expand Down
3 changes: 2 additions & 1 deletion examples/components/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import React from 'react';
import PropTypes from 'prop-types';
import Radium from '../../src';

@Radium class Button extends React.Component {
@Radium
class Button extends React.Component {
render() {
return (
<button
Expand Down
16 changes: 7 additions & 9 deletions interfaces/inline-style-prefixer.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
declare class InlineStylePrefixer {
static prefixAll: typeof prefixAll,
static prefixAll: typeof prefixAll;

prefixedKeyframes: string,
prefixedKeyframes: string;

constructor(
config: {
keepUnprefixed?: boolean,
userAgent?: ?string
}
): void,
constructor(config: {
keepUnprefixed?: boolean,
userAgent?: ?string
}): void;

prefix(style: Object): Object
prefix(style: Object): Object;
}

declare function prefixAll(style: Object): Object;
Expand Down
18 changes: 17 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
"examples": "webpack-dev-server --config examples/webpack.config.js --no-info --content-base examples",
"examples-server": "babel-node examples/server.js",
"flow": "flow check",
"format": "prettier --write \"{src,examples}/**/*.js\"",
"format-check": "prettier --list-different \"{src,examples}/**/*.js\"",
"eslint": "eslint .",
"fixlint": "npm run eslint -- --fix",
"lint": "builder concurrent --buffer eslint flow",
Expand Down Expand Up @@ -63,7 +65,9 @@
"babel-preset-stage-1": "^6.22.0",
"builder": "^3.2.3",
"exenv": "^1.2.1",
"husky": "^1.2.0",
"inline-style-prefixer": "^4.0.0",
"lint-staged": "^8.1.0",
"prop-types": "^15.5.8",
"publishr": "^1.0.0",
"rimraf": "^2.6.1",
Expand Down Expand Up @@ -105,7 +109,7 @@
"node-libs-browser": "^2.0.0",
"nodemon": "^1.11.0",
"object-assign": "^4.1.1",
"prettier": "^0.22.0",
"prettier": "^1.15.3",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-test-renderer": "^16.2.0",
Expand All @@ -127,5 +131,17 @@
"scripts": {
"postinstall": ""
}
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.js": [
"yarn format",
"yarn fixlint",
"git add"
]
}
}
6 changes: 1 addition & 5 deletions src/__tests__/enhancer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,7 @@ describe('Enhancer', () => {
return [{color: 'black'}];
}
render() {
return (
<div style={this.getStyles()}>
Hello World!
</div>
);
return <div style={this.getStyles()}>Hello World!</div>;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/get-state-key-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('getStateKey', () => {
it('gets the key if the ref is not a string', () => {
class Test extends React.Component {
render() {
return <div key="myKey" ref={ref => this.ref = ref} />;
return <div key="myKey" ref={ref => (this.ref = ref)} />;
}
}

Expand Down
15 changes: 10 additions & 5 deletions src/__tests__/keyframes-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {expectCSS, getElement} from 'test-helpers';
import React, {Component} from 'react';
import TestUtils from 'react-dom/test-utils';

const CHROME_14_USER_AGENT = 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.1 ' +
const CHROME_14_USER_AGENT =
'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.1 ' +
'(KHTML, like Gecko) Chrome/14.0.812.0 Safari/535.1';

describe('keyframes', () => {
Expand Down Expand Up @@ -243,13 +244,15 @@ describe('keyframes', () => {
'SlideFromLeft'
);

@Radium class ChildComponent extends Component {
@Radium
class ChildComponent extends Component {
render() {
return <div style={{animationName: animation}} />;
}
}

@Radium class TestComponent extends Component {
@Radium
class TestComponent extends Component {
render() {
return (
<StyleRoot>
Expand Down Expand Up @@ -294,13 +297,15 @@ describe('keyframes', () => {
'SlideFromTop'
);

@Radium class ChildComponent extends Component {
@Radium
class ChildComponent extends Component {
render() {
return <div style={{animationName: [animation, animation2]}} />;
}
}

@Radium class TestComponent extends Component {
@Radium
class TestComponent extends Component {
render() {
return (
<StyleRoot>
Expand Down
7 changes: 4 additions & 3 deletions src/__tests__/media-query-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,8 @@ describe('Media query tests', () => {
// we only get called with `(undefined, { componentStack: STUFF })` just accept
// it until we understand more.
expect(catchSpy).to.have.callCount(1);
expect(catchSpy.getCall(0).args[1]).to.have
.property('componentStack')
expect(catchSpy.getCall(0).args[1])
.to.have.property('componentStack')
.that.contains('Component');
});

Expand All @@ -409,7 +409,8 @@ describe('Media query tests', () => {
</div>
));
expect(() =>
TestUtils.renderIntoDocument(<TestComponent />)).not.to.throw();
TestUtils.renderIntoDocument(<TestComponent />)
).not.to.throw();
});

it("doesn't try to setState if not mounted", () => {
Expand Down
Loading

0 comments on commit eb4ab48

Please sign in to comment.