This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fdsfds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { render } from '@testing-library/react' | |
import { Gists } from './gists.component' | |
describe('gists.component', () => { | |
it('should show only the error message if fetching failed', async () => { | |
const useGists: any = jest.fn(() => [null, 'this is the error']) | |
const { getByText, queryByText } = render(<Gists useGists={useGists} />) | |
await getByText('this is the error') | |
expect(queryByText('Prev')).toBe(null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface Gist { | |
url: string | |
} | |
export const useGists = (page: number = 0): [Gist[] | null, string?] => { | |
const [gists, setGists] = useState(null) | |
const [error, setError] = useState() | |
useEffect(() => { | |
let mounted = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface GistsProps { | |
useGists: (page?: number) => [Gist[] | null, string?]; | |
} | |
export const Gists: React.FC<GistsProps> = props => { | |
const [page, setPage] = useState(0); | |
const [gists, error] = props.useGists(page); | |
if (error !== undefined) { | |
return <div>{error}</div>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { GistList } from './gists.component' | |
import { useGists } from './gists.control' | |
function App () { | |
const [whichList, setWhichList] = useState(0) | |
return ( | |
<> | |
<h1>Fetching GitHub Gists</h1> | |
<button onClick={() => setWhichList(0)}>List 1</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
swagger: "2.0" | |
info: | |
description: $API_DESCRIPTION | |
version: $API_VERSION | |
title: $API_TITLE | |
host: "api.truckin.io" | |
basePath: "/v3" | |
schemes: | |
- "http" | |
- "https" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Code review-t kérnénk a meglévő kódbázisra, egyelőre csak backend (~7.000 sor). | |
A mostani architektúra áttekintése, esetleges szűk keresztmetszetek, problémák kiszűrése | |
RabbitMQ-t használó microservice-t hogyan lehet unit tesztelni?Hogyan lehet unit tesztet írni AMQP (amqplib) protokollt használó JS alkalmazáshoz, ami nem integration teszt. (Jelenleg integration tesztek vannak, localhost rabbitmq docker image segítségével). Létezik-e JS-hez amqplib mock library (én nem találtam)? | |
**Mi írtunk egyet: https://github.com/lab-coop/lab-queue/blob/master/implementations/memory/index.js de ez nem tudom, hogy jelenleg production ready-e, illetve exchange kezeles nincs benne.** | |
Jó-e a jelenlegi architektúra elképzelés RabbitMQ-val? (ts_exchange (topic), routing, log_exchange a logoknak, minden uS ide beszél | |
Hogyan lenne célszerű megoldani, hogy egy TS önállóan is tudjon működni, ha leszakad a hálózatról, de úgy, hogy a jelenleg megírt AMQP-s modulokat ne kelljen újraírni (TS helyi Rabbit broker?) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function t(r) { | |
return r[0].toUpperCase() + r.substring(1) | |
} | |
this.warren = this.warren || {}, this.warren.angular = this.warren.angular || {}, warren.angular.controller = function(r, e, n) { | |
n = n || {}; | |
var l = r.replace("warren.", "").split(".")[0], | |
a = r.replace(/^warren\.\w+\./, "").split("."), | |
o = a[a.length - 1], | |
i = a.map(function(r) { | |
return t(r) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as firebase from 'firebase'; | |
const actionNames = { | |
INPUT_CHANGED: 'INPUT_CHANGED', | |
TOGGLE_NOTIFICATION: 'TOGGLE_NOTIFICATION', | |
LOGGEDIN: 'LOGGEDIN', | |
LOGGEDOUT: 'LOGGEDOUT', | |
LOGIN_ERROR: 'LOGIN_ERROR' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST /jobs | |
{ | |
"images": [ | |
"https://somewhere/ImageName1.jpg", | |
"https://somewhere/ImageName2.jpg", | |
"https://somewhere/ImageName3.jpg", | |
"https://somewhere/ImageName4.jpg", | |
"https://somewhere/ImageName5.jpg", | |
"https://somewhere/ImageName6.jpg", | |
"https://somewhere/ImageName7.jpg" |
NewerOlder