Skip to content

Instantly share code, notes, and snippets.

sivagao /
Created Jan 28, 2019
JavaScript Testing Overview with pingcap adaptor

An Overview of JavaScript Testing

通常来说,JS 开发者不习惯网站开发测试,JS 测试一般会很局限,难以实施,运行慢和写起来费时。

Test Types


  • 单元测试 Unit Tests- Testing of individual functions or classes by supplying input and making sure the output is as expected.
  • 集成测试 Integration Tests- Testing processes or components to behave as expected, including the side effects.
sivagao / cloudSettings
Created May 22, 2018
Visual Studio Code Settings Sync Gist
View cloudSettings
View top10k_chromeexts
cfhdojbkjhnklbpkdaibdccddilifddb Adblock Plus 10000000
gighmmpiobklfepjocnamgkkbiglidom AdBlock 10000000
efaidnbmnnnibpcajpcglclefindmkaj Adobe Acrobat 10000000
gomekmidlodglbbmalcneegieacbdmki Avast Online Security 10000000
eofcbnmajmjmplflapaojjnihcjkigck Avast SafePrice 10000000
chfdnecihphmhljaaejmgoiahnihplgn AVG Web TuneUp 10000000
flliilndjeohchalpbbcdekjklbdgfkk Avira Browser Safety 10000000
gpdjojdkbbmdfjfahjcgigfpmkopogic Pin It Button 10000000
lifbcibllhkdhoafpjfnlhfpfgnpldfl Skype 10000000
mallpejgeafdahhflmliiahjdpgbegpk FromDocToPDF 9298905
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<script src=""></script>
var width = 960,
height = 700;
var svg ="body").append("svg")
sivagao / index.jade
Created Apr 30, 2014
A Pen by siva Gao.
View index.jade
each item in [1,2,3,4]
h2 Warm Welcome
p When she reached the first hills of the Italic Mountains, she had a last view back on the skyline of her hometown Bookmarksgrove, the headline of Alphabet Village and the subline of her own road, the Line Lane.
a.da-link Read More
View 避免重复查询requery
<!doctype html>
<html lang="en">
<title>JavaScript 模式和反模式</title>
<meta charset="utf-8">
/* 题目: 重复查询
* 描述: 使用jQuery的链接,可以避免重复查询
View 窗口滚动事件
<!doctype html>
<html lang="en">
<title>JavaScript 模式和反模式</title>
<meta charset="utf-8">
/* 题目: 窗口滚动事件
* 描述: 不要在窗口滚动事件上附加事件处理程序
sivagao / scrollfixnavbar.js
Created Jan 11, 2014
scroll to fix navbar
View scrollfixnavbar.js
$(document).ready(function() {
var navpos = $('#mainnav').offset();
$(window).bind('scroll', function() {
if ($(window).scrollTop() > {
else {
You can’t perform that action at this time.