blog   694918

« earlier    

Testing a Node.js HTTP server with Mocha ·

You may notice that the server doesn’t start automatically. You have to call listen for anything to happen. Setting up the server like this makes require idempotent, which is a good thing.


I happen to use Mocha for testing, but the concepts described here should be applicable to other JavaScript test frameworks.

Before getting to the actual tests, there’s a little bit of boilerplate to get out of the way. The test suite should fire up the server when it starts and kill the server when it finishes.

var server = require('../lib/server');
nodejs  http  node  test  blog 
3 hours ago by ndf
goTenna Mesh Review: Disaster-Proof Ultra-Portable Phone Network That Fits In Your Pocket
This little thumb sized travel gadget could save your life. The goTenna Mesh is one of the most impressive new travel products I’ve come across recently. It will fundamentally change the way you communicate with people that you travel with, in the best way possible.
travel  blog  family  holiday  With  Bender 
5 hours ago by travelwithbender
Farnam Street
Farnam Street is devoted to helping you develop an understanding of how the world really works, make better decisions, and live a better life.
blog  inspiration 
7 hours ago by karlschwaier
DayGram - 1 line a day Diary в App Store
DayGram - 1 line a day Diary: чтение обзоров, сравнение оценок покупателей, просмотр иллюстраций и дополнительной информации о приложении. Загрузка приложения DayGram - 1 line a day Diary для iPhone, iPad или iPod touch.
ios  appstore  blog  text  diary  daygram 
8 hours ago by moalex
Freelance Cafe
a support, networking, and resource center for freelancers, artists, contractors, and other independents
audio  community  blog  events 
9 hours ago by xyai
This Teen Has Reviewed Hundreds Of MBTA Stations And Lines | WBUR News
“We read it not just because we enjoy it. We’re all transit nerds in a similar way," says David Block-Schacter, the MBTA's chief technology officer. "We also read it because when we’re trying to figure out something about a station, usually he’s the best resource on the web.”

Miles has already finished reviewing all of the core T subway lines (the Red, Blue, Green and Orange lines), and he has just 22 more commuter rail stations to check before going off to college.

miles on the mbta getting the recognition it deserves
boston  transit  mbta  blog 
10 hours ago by madamim

« earlier    

related tags

#blogroll  accessibility  adobe  adventure  advice  advocacy  aggregator  ai  alignment  amazon  analysis  api  appstore  architecture  art  article-listing  article  audio  aws  bash  bender  blogging  blogs  book  boston  brioche  c++  canada  cannabis  case  cdsw  chess  clojure  comics  community  concept  consumer  contenido  content-marketing  coolstuff  couchdb  cpu  cryptocurrency  css  css3  ct  culture  curacion  data  database  david  daygram  design  developer  diary  digging  discovery  e-learning  ecclesiology  ecommerce  editorial  editors  education  elearning  emacs  erik  escribir  events  examples  experience  exploit  family  fashion  feed  finance  floats  france  free  freelancer  game  github  go  golang  google  gpg  graphic  grid  guardian  guide  guides  hexo  history  holiday  homepage  horror  howto  html  http  ia  iheni  image  information  inspiration  interaction  ios  isssues  issue  java  javascript  journalism  json  kafka  language  layout  lego  levain  linux  liquidación  love  mac  macbook  machine_learning  machinelearning  machinevision  macos  magazine  malware  mbta  meltdown  micro  moblog  monitoring  music  navigation  news  node  nodejs  nosql  open  osx  paid  photography  poc  podcast  portfolio  post  poučevanje  processes  productivity  programmer  programming  prototypes  psychology  računalništvo  reading  recette  records  reference  research  retail  review  reviews  rss  says  security  servers  shogi  society  software-design  software-development  software  spectre  ssh  studies  supervisord  surus  tech  technology  test  text  thailand  thauvin  theme  themeisle  theology  tips  today  tolearn  tool  tools  toread  totry  tounderstand  training  transit  travel  tresse  tutorial  tutorials  typography  ui  unix  update  url  usabil  user-experience  user-interface  user  ux  visual  visualization  vulnerability  walsh  web-design  web-development  web-experience  web-programming  web  webcomics  webdesign  weblog  wikimedia  wikimetrics  with  wordpress  wuppertal  zsh 

Copy this bookmark: