Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bot] Run grit migration: Apply a GritQL pattern #4

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions components/card.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import React from 'react';
import PropTypes from "prop-types";

export const Card = (props) => {
return (
export const Card = (props) => (
<div className="card">
<h3>{props.title}{props.count ? `(${props.count})` : ''}</h3>
{props.children}
</div>
);
};


Card.propTypes = {
Expand Down
4 changes: 1 addition & 3 deletions components/para.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
export const Paragraph = (props: { children: string }) => {
return <p>{props.children}</p>;
};
export const Paragraph = (props: { children: string }) => <p>{props.children}</p>;
14 changes: 7 additions & 7 deletions test/divide.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ const assert = require('chai').assert

const divide = require('../utils/divide');

describe('divide', function () {
it('divides 4 by 2 to equal 2', function () {
assert.equal(divide(4, 2), 2);
});
it('divides -4 by 2 to equal -2', function () {
assert.equal(divide(-4, 2), -2);
});
describe('divide', () => {
it('divides 4 by 2 to equal 2', () => {
assert.equal(divide(4, 2), 2);
});
it('divides -4 by 2 to equal -2', () => {
assert.equal(divide(-4, 2), -2);
});
});
14 changes: 7 additions & 7 deletions test/multiply.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ const assert = require('chai').assert

const multiply = require('../utils/multiply');

describe('multiply', function () {
it('should work for positive numbers', function () {
assert.equal(multiply(3, 2), 6, '3 times 2 is 6');
});
it('should work for odd numbers', function () {
const val = 11;
describe('multiply', () => {
it('should work for positive numbers', () => {
assert.equal(multiply(3, 2), 6, '3 times 2 is 6');
});
it('should work for odd numbers', () => {
const val = 11;

assert.equal(multiply(2, val), 22, '2 times 11 is 22');
});
});
});
6 changes: 3 additions & 3 deletions utils/sum.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
function sum(values) {
console.log("nice", values);

return values.reduce(function (a, b) {
return a + b;
});
return values.reduce((a, b) => {
return a + b;
});
}
module.exports = sum;