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
# http://webapps.stackexchange.com/questions/39587/view-estimated-size-of-github-repository-before-cloning | |
# tested on macOS | |
echo https://github.com/torvalds/linux.git | perl -ne 'print $1 if m!([^/]+/[^/]+?)(?:\.git)?$!' | xargs -I{} curl -s -k https://api.github.com/repos/'{}' | grep size | |
# output: | |
# "size": 1746294, |
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 Counter from "./Counter"; | |
it("Counter ์ปดํฌ๋ํธ๋ฅผ ๋ ๋๋งํฉ๋๋ค", () => { | |
const { getByText } = render(<Counter />); | |
getByText("Counter: 0"); | |
getByText("+"); | |
getByText("-"); |
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
// Counter.test.js | |
import { getQueriesForElement } from "@testing-library/dom"; | |
import ReactDOM, { unmountComponentAtNode } from "react-dom"; | |
import { act } from "react-dom/test-utils"; | |
import Counter from "./Counter"; | |
let container = null; | |
export const render = (element) => { | |
container = document.createElement("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
// Counter.test.js | |
import { getQueriesForElement } from "@testing-library/dom"; | |
import ReactDOM, { unmountComponentAtNode } from "react-dom"; | |
import { act } from "react-dom/test-utils"; | |
import Counter from "./Counter"; | |
let container = null; | |
beforeEach(() => { | |
container = document.createElement("div"); | |
document.body.appendChild(container); |
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
// Counter.test.js | |
import ReactDOM, { unmountComponentAtNode } from "react-dom"; | |
import { act } from "react-dom/test-utils"; | |
import Counter from "./Counter"; | |
let container = null; | |
beforeEach(() => { | |
// ๋ ๋๋ง ์ปจํ ์ด๋๋ก ํ์ฉํ๊ธฐ ์ํ DOM element ๋ฅผ ์์ฑํฉ๋๋ค | |
container = document.createElement("div"); | |
document.body.appendChild(container); |
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, { useState } from "react"; | |
export default function Counter() { | |
const [count, setCount] = useState(0); | |
return ( | |
<div> | |
<h1>Counter: {count}</h1> | |
<button data-testid="dec" onClick={() => setCount((count) => count - 1)}> | |
- |
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 { unmountComponentAtNode } from "react-dom"; | |
let container = null; | |
beforeEach(() => { | |
// ๋ ๋๋ง ์ปจํ ์ด๋๋ก ํ์ฉํ๊ธฐ ์ํ DOM element ๋ฅผ ์์ฑํฉ๋๋ค | |
container = document.createElement("div"); | |
document.body.appendChild(container); | |
}); |
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
FROM node:12 | |
WORKDIR /app | |
COPY ./package*.json ./ | |
RUN npm install | |
ENV PORT=4000 | |
COPY . . | |
CMD ["npm","run","start"] |