- TBA
- [wvw group boon share chronomancer][]
- [wvw roaming hybrid mirage][]
| // # Mocha Guide to Testing | |
| // Objective is to explain describe(), it(), and before()/etc hooks | |
| // 1. `describe()` is merely for grouping, which you can nest as deep | |
| // 2. `it()` is a test case | |
| // 3. `before()`, `beforeEach()`, `after()`, `afterEach()` are hooks to run | |
| // before/after first/each it() or describe(). | |
| // | |
| // Which means, `before()` is run before first it()/describe() |
| function p2(text){ | |
| return text < 10 ? "0"+text : text; | |
| } | |
| function getContainedNode(node){ | |
| var p = node; | |
| while(p){ | |
| if(p && p.classList){ | |
| if(p.classList.contains("UFIComment")){ | |
| return {type:"comment",node:p}; |
| // before | |
| // 通常這四個都有個共通的因素,才會被擺在一起 | |
| if (rtn == RESULT_A || rtn == RESULT_B || rtn == RESULT_C || rtn == RESULT_D) { | |
| Do1(); | |
| } else { | |
| Do2(); | |
| } | |
| // after | |
| // 所以就把那個因素寫成 function name |
| upload(files) { | |
| const config = { | |
| onUploadProgress: function(progressEvent) { | |
| var percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total) | |
| console.log(percentCompleted) | |
| } | |
| } | |
| let data = new FormData() | |
| data.append('file', files[0]) |