# JSDoc {{{ snippet jsdoc alias jd /** * ${1} */ snippet onelinerjsdoc alias ojd /** ${1} */ # }}} # Express {{{ snippet express 'use strict'; var Path = require('path'); var Http = require('http'); var express = require('express'); var PUBLIC_DIR = Path.join(__dirname, 'public'); var PORT = process.env.PORT || 8080; var HOSTNAME = 'localhost'; var app = express(); app.use(express.static(PUBLIC_DIR)); Http.createServer(app).listen(PORT, HOSTNAME, function () { console.log(\`http://${HOSTNAME}:${PORT} にブラウザでアクセスしてください\`); }); # }}} # Mocha {{{ snippet describe alias d describe('${1}', function() { ${0} }); snippet it alias i it('should ${1}', function() { ${0} }); snippet context alias c context('when ${1}', function() { ${0} }); snippet after alias a after(function() { ${0} }); snippet afterEach afterEach(function() { ${0} }); snippet before alias b before(function() { ${0} }); snippet beforeEach beforeEach(function() { ${0} }); # }}} # chai {{{ snippet require-chai alias chai var chai = require('chai'); var assert = chai.assert; # }}} # assert {{{ snippet require-assert alias assert var assert = require('assert'); # }}} # selenium-webdriver {{{ snippet require-selenium-webdriver alias selenium-webdriver var webdriver = require('selenium-webdriver'); var By = webdriver.By; var testing = require('selenium-webdriver/testing'); var describe = testing.describe; var it = testing.it; var context = testing.context; var before = testing.before; var after = testing.after; var beforeEach = testing.beforeEach; var afterEach = testing.afterEach; describe('${1}', function() { var driver; before(function() { driver = new webdriver.Builder() .forBrowser("Chrome") .build(); }); ${0} after(function() { return driver.quit(); }); }); # }}} # vim: fdm=marker