Skip to content

Commit

Permalink
Bump prettier to 1.5.2 (jestjs#3965)
Browse files Browse the repository at this point in the history
* Bump prettier to 1.5.2

* Fix unexpected string concatenation

* Extract isSymbol helper and fix flow
  • Loading branch information
thymikee authored and cpojer committed Jul 4, 2017
1 parent 06973fc commit ab6f4c3
Show file tree
Hide file tree
Showing 59 changed files with 454 additions and 334 deletions.
4 changes: 1 addition & 3 deletions examples/react-native/Intro.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ export default class Intro extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.welcome}>Welcome to React Native!</Text>
<Text style={styles.instructions}>
This is a React Native snapshot test.
</Text>
Expand Down
5 changes: 4 additions & 1 deletion examples/react-native/__tests__/intro.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ it('renders the ListView component', () => {
.create(
<ListView
dataSource={dataSource}
renderRow={rowData => <Text>{rowData}</Text>}
renderRow={rowData =>
<Text>
{rowData}
</Text>}
/>
)
.toJSON();
Expand Down
4 changes: 3 additions & 1 deletion examples/snapshot/Clock.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ export default class Clock extends React.Component {

render() {
return (
<p>{this.state.seconds} seconds have ellapsed since the UNIX epoch.</p>
<p>
{this.state.seconds} seconds have ellapsed since the UNIX epoch.
</p>
);
}
}
6 changes: 5 additions & 1 deletion examples/snapshot/__tests__/link.react.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ it('renders as an anchor when no page is set', () => {

it('properly escapes quotes', () => {
const tree = renderer
.create(<Link>{"\"Facebook\" \\'is \\ 'awesome'"}</Link>)
.create(
<Link>
{"\"Facebook\" \\'is \\ 'awesome'"}
</Link>
)
.toJSON();
expect(tree).toMatchSnapshot();
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"micromatch": "^2.3.11",
"mkdirp": "^0.5.1",
"mocha": "^3.4.2",
"prettier": "1.3.1",
"prettier": "^1.5.2",
"progress": "^1.1.8",
"react": "15.4.2",
"react-addons-test-utils": "15.4.2",
Expand Down
7 changes: 4 additions & 3 deletions packages/babel-jest/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ const createTransformer = (options: any) => {
break;
}
const resolvedJsonFilePath = path.join(directory, PACKAGE_JSON);
const packageJsonFilePath = resolvedJsonFilePath === PACKAGE_JSON
? path.resolve(directory, PACKAGE_JSON)
: resolvedJsonFilePath;
const packageJsonFilePath =
resolvedJsonFilePath === PACKAGE_JSON
? path.resolve(directory, PACKAGE_JSON)
: resolvedJsonFilePath;
if (fs.existsSync(packageJsonFilePath)) {
// $FlowFixMe
const packageJsonFileContents = require(packageJsonFilePath);
Expand Down
7 changes: 4 additions & 3 deletions packages/jest-changed-files/src/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ function findChangedFiles(
options?: Options,
): Promise<Array<Path>> {
return new Promise((resolve, reject) => {
const args = options && options.lastCommit
? ['show', '--name-only', '--pretty=%b', 'HEAD']
: ['ls-files', '--other', '--modified', '--exclude-standard'];
const args =
options && options.lastCommit
? ['show', '--name-only', '--pretty=%b', 'HEAD']
: ['ls-files', '--other', '--modified', '--exclude-standard'];
const child = childProcess.spawn('git', args, {cwd});
let stdout = '';
let stderr = '';
Expand Down
4 changes: 2 additions & 2 deletions packages/jest-circus/src/format_node_assert_errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ const getOperatorName = (operator: ?string, stack: string) => {
const operatorMessage = (operator: ?string, negator: boolean) =>
typeof operator === 'string'
? operator.startsWith('!') || operator.startsWith('=')
? `${negator ? 'not ' : ''}to be (operator: ${operator}):\n`
: `${humanReadableOperators[operator] || operator} to:\n`
? `${negator ? 'not ' : ''}to be (operator: ${operator}):\n`
: `${humanReadableOperators[operator] || operator} to:\n`
: '';

const assertThrowingMatcherHint = (operatorName: string) => {
Expand Down
4 changes: 3 additions & 1 deletion packages/jest-circus/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ const getEachHooksForTest = (

const _makeTimeoutMessage = (timeout, isHook) =>
new Error(
`Exceeded timeout of ${timeout}ms for a ${isHook ? 'hook' : 'test'}.\nUse jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test.`,
`Exceeded timeout of ${timeout}ms for a ${isHook
? 'hook'
: 'test'}.\nUse jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test.`,
);

// Global values can be overwritten by mocks or tests. We'll capture
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-cli/src/__tests__/search_source.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ describe('SearchSource', () => {
name,
rootDir,
testMatch: null,
testRegex: 'test\.jsx?',
testRegex: 'test.jsx?',
},
{},
);
Expand Down
Loading

0 comments on commit ab6f4c3

Please sign in to comment.