Skip to content

Instantly share code, notes, and snippets.

View r3dm1ke's full-sized avatar
🎯
Before software can be reusable it first has to be usable.

Michael Krasnov r3dm1ke

🎯
Before software can be reusable it first has to be usable.
View GitHub Profile
name: Test & Publish
on:
push:
branches:
- master
jobs:
publish:
name: Install and publish
runs-on: ubuntu-latest
steps:
@r3dm1ke
r3dm1ke / review.yml
Last active February 26, 2020 18:07
name: Preview on Expo
on: [pull_request]
jobs:
publish:
name: Install and publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
@r3dm1ke
r3dm1ke / tests.yml
Last active February 25, 2020 17:14
name: Run test suite
on: [pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
import React from 'react';
import {render, cleanup, fireEvent} from 'react-native-testing-library';
import App from './App';
afterEach(cleanup);
describe('<App />', () => {
it('should match snapshot', () => {
const rendered = render(<App />).toJSON();
@r3dm1ke
r3dm1ke / App.js
Last active February 25, 2020 17:03
import React, {useState} from 'react';
import { StyleSheet, Text, View, Button } from 'react-native';
export default function App() {
const [counter, setCounter] = useState(0);
return (
<View style={styles.container}>
<Text
style={styles.label}
testID={'counter'}
module.exports = {
projects: [
{ preset: 'jest-expo/ios' },
{ preset: 'jest-expo/android' }
],
transformIgnorePatterns: [
'node_modules/(?!(jest-)?react-native|react-native-base64|react-clone-referenced-element|@react-native-community|expo(nent)?|@expo(nent)?/.*|react-utils|@react-utils/.*|@unimodules/.*|sentry-expo|native-base)'
],
};
import React from 'react';
import IssueList from './IssueList';
import {
ExpansionPanel,
ExpansionPanelSummary,
ExpansionPanelDetails,
Typography,
Chip,
makeStyles
} from '@material-ui/core';
import React, {useState} from 'react';
import {Dialog, DialogContent, ListItem, ListItemText} from '@material-ui/core'
const Issue = ({title, bodyHTML}) => {
const [dialogOpened, setDialogOpened] = useState(false);
return (
<>
<ListItem button onClick={() => setDialogOpened(true)}>
<ListItemText>{title}</ListItemText>
</ListItem>
import React, {useState, useEffect} from 'react';
import {useQuery} from "@apollo/react-hooks";
import {Typography, makeStyles, CircularProgress} from "@material-ui/core";
import {useDebounce} from "use-debounce";
import {SEARCH_FOR_REPOS} from "./queries";
import Repository from "./Repository";
const useStyles = makeStyles({
note: {
marginTop: '1rem',
import React from 'react';
import {
ExpansionPanel,
ExpansionPanelSummary,
ExpansionPanelDetails,
Typography,
Chip,
makeStyles
} from "@material-ui/core";
import StarIcon from '@material-ui/icons/Star';