- https://jestjs.io/
- 테스트 파일 확장자는 *.test.js 또는 *.spec.js
npm i -g jest
- 개별 파일
var commons = { | |
drop: function (list, i) { | |
return list.slice(0, i).concat(list.slice(i + 1)); | |
}, | |
getOptions: function(list, vkey, nkey) { | |
var listHtml = ""; | |
for (var i=0 ; i<list.length ; i++) { | |
listHtml += "<option value='"; | |
listHtml += list[i][vkey]; |
$.fn.money = function() { | |
var M = {}; | |
M = { | |
prefix: "$ ", | |
floatFlag: "off", | |
format: function() { | |
M.config(this); | |
var n = $(this).val().replace(/[\$\s,]/g, ""); |
$("#checkAll").on("click", function(){ | |
var sts = $("#checkAll").attr("checked") == "checked"; | |
$('input[name="code"]').attr("checked", sts); | |
}); |
$("#frm").serialize().split("&").sort(); | |
private static final Logger logger = LoggerFactory.getLogger(Commons.class); | |
public static void writeJSON(HttpServletResponse response, | |
final String label, final Object data) { | |
JSONObject jsonObj = new JSONObject(); | |
jsonObj.put(label, data); | |
response.setContentType("application/json; charset=UTF-8"); |
function loadJQuery() { | |
var oScript = document.createElement("script"); | |
oScript.type = "text/javascript"; | |
oScript.charset = "utf-8"; | |
oScript.src = "http://code.jquery.com/jquery-1.6.2.min.js"; | |
document.getElementsByTagName("head")[0].appendChild(oScript); | |
} |
var cLink = document.createElement("link"); | |
cLink.rel = "stylesheet"; | |
cLink.type = "text/css"; | |
cLink.href = "/event/200908/nas.css"; | |
document.getElementsByTagName("head")[0].appendChild(cLink); |
package com.okdevtv; | |
import static org.junit.Assert.*; | |
import java.io.UnsupportedEncodingException; | |
import java.net.URLDecoder; | |
import org.junit.Test; | |
public class KrDecoderTest { | |
@Test |
npm i -g jest
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)); | |
}); |
* 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'); | |
}); | |
``` |