- https://jestjs.io/
- 테스트 파일 확장자는 *.test.js 또는 *.spec.js
npm i -g jest
- 개별 파일
<project> | |
... | |
<properties> | |
<findbugs.version>2.5.2</findbugs.version> | |
<checkstyle.version>2.9.1</checkstyle.version> | |
<surefire.reportplugin.version>2.12.4</surefire.reportplugin.version> | |
<cobertura.version>2.5.2</cobertura.version> | |
</properties> | |
import { useState, useEffect } from 'react' | |
import logo from './logo.svg' | |
import './App.css' | |
function App() { | |
const [count, setCount] = useState(0) | |
function getHello() { | |
const greet = document.getElementById('greet') | |
fetch('http://localhost:4000/api/hello') | |
.then(response => response.json()) |
name: remote ssh command for deploy | |
on: | |
push: | |
branches: [main] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: executing remote ssh commands using key |
echo "0 0,12 * * * root python -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew" | sudo tee -a /etc/crontab > /dev/null | |
cat /etc/crontab |
location / { | |
sendfile off; | |
proxy_pass http://127.0.0.1:4000; | |
proxy_redirect default; | |
proxy_http_version 1.1; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_cache_bypass $http_upgrade; |
const express = require('express'); | |
const router = express.Router(); | |
/** | |
* @openapi | |
* /api/hello: | |
* get: | |
* description: Welcome to swagger-jsdoc! | |
* parameters: | |
* - name: name | |
* in: query |
* Hide line of issues with `Bump` keyword. | |
* Use this code in console of GitHub issue list page. | |
```js | |
const issues = document.querySelectorAll('.js-issue-row'); | |
[...issues].forEach((issue, idx) => { | |
issues[idx].hidden = issue.innerText.includes('Bump'); | |
}); | |
``` |
var items = document.querySelectorAll('[id=dismissable]') | |
items.forEach(item => { | |
var data = { | |
title: item.children[1].children[0].children[0].innerText, | |
link: item.children[1].children[0].children[0].children[1].href, | |
meta: item.children[1].children[0].children[1].innerText | |
}; | |
console.log(JSON.stringify(data)); | |
}); |
npm i -g jest
package com.okdevtv; | |
import static org.junit.Assert.*; | |
import java.io.UnsupportedEncodingException; | |
import java.net.URLDecoder; | |
import org.junit.Test; | |
public class KrDecoderTest { | |
@Test |