utils.test.js
This file
Path
test/utils.test.js
29 lines · 1.2 KiB · JavaScript
Last changed by
moved files from lib/express/* to lib/Tj Holowaychukbefore adoption3d597a5
History of this fileTake it
The walk stopped after 200 commits: lines older than 544d688 point at it.
Fixed express(1) support for < 0.3.xTj Holowaychukbefore adoption544d688
lines 1–5why, one step back12/**3 * Module dependencies.4 */5moved files from lib/express/* to lib/Tj Holowaychukbefore adoption3d597a5
line 6why, one step back6var utils = require('../lib/utils')Fixed express(1) support for < 0.3.xTj Holowaychukbefore adoption544d688
lines 7–29why, one step back7 , should = require('should');89module.exports = {10 'test .miniMarkdown()': function(){11 utils.miniMarkdown('_foo_').should.equal('<em>foo</em>');12 utils.miniMarkdown('*foo*').should.equal('<em>foo</em>');13 utils.miniMarkdown('**foo**').should.equal('<strong>foo</strong>');14 utils.miniMarkdown('__foo__').should.equal('<strong>foo</strong>');15 utils.miniMarkdown('_foo__').should.equal('<em>foo</em>_'); 16 utils.miniMarkdown('[User Login](/login)').should.equal('<a href="/login">User Login</a>');17 },18 19 'test .parseRange()': function(){20 utils.parseRange(1000, 'bytes=0-499').should.eql([{ start: 0, end: 499 }]);21 utils.parseRange(1000, 'bytes=40-80').should.eql([{ start: 40, end: 80 }]);22 utils.parseRange(1000, 'bytes=-500').should.eql([{ start: 500, end: 999 }]);23 utils.parseRange(1000, 'bytes=-400').should.eql([{ start: 600, end: 999 }]);24 utils.parseRange(1000, 'bytes=500-').should.eql([{ start: 500, end: 999 }]);25 utils.parseRange(1000, 'bytes=400-').should.eql([{ start: 400, end: 999 }]);26 utils.parseRange(1000, 'bytes=0-0').should.eql([{ start: 0, end: 0 }]);27 utils.parseRange(1000, 'bytes=-1').should.eql([{ start: 999, end: 999 }]);28 }29};