X-Git-Url: https://git.cworth.org/git?p=obsolete%2Fnotmuch-web;a=blobdiff_plain;f=node_modules%2Fexpress%2Fnode_modules%2Fqs%2Fsupport%2Fexpresso%2Ftest%2Fassert.test.js;fp=node_modules%2Fexpress%2Fnode_modules%2Fqs%2Fsupport%2Fexpresso%2Ftest%2Fassert.test.js;h=f822595aa31f816dcbd19b725ca7dca276d0b55f;hp=0000000000000000000000000000000000000000;hb=410c776334299b52b7df74c53dafe761ad51cf0d;hpb=df790f70fe96623e5d2469daedaf7114bde13426 diff --git a/node_modules/express/node_modules/qs/support/expresso/test/assert.test.js b/node_modules/express/node_modules/qs/support/expresso/test/assert.test.js new file mode 100644 index 0000000..f822595 --- /dev/null +++ b/node_modules/express/node_modules/qs/support/expresso/test/assert.test.js @@ -0,0 +1,91 @@ + +/** + * Module dependencies. + */ + +var assert = require('assert'); + +module.exports = { + 'assert.eql()': function(){ + assert.equal(assert.deepEqual, assert.eql); + }, + + 'assert.type()': function(){ + assert.type('foobar', 'string'); + assert.type(2, 'number'); + assert.throws(function(){ + assert.type([1,2,3], 'string'); + }); + }, + + 'assert.includes()': function(){ + assert.includes('some random string', 'dom'); + assert.throws(function(){ + assert.include('some random string', 'foobar'); + }); + + assert.includes(['foo', 'bar'], 'bar'); + assert.includes(['foo', 'bar'], 'foo'); + assert.includes([1,2,3], 3); + assert.includes([1,2,3], 2); + assert.includes([1,2,3], 1); + assert.throws(function(){ + assert.includes(['foo', 'bar'], 'baz'); + }); + + assert.throws(function(){ + assert.includes({ wrong: 'type' }, 'foo'); + }); + }, + + 'assert.isNull()': function(){ + assert.isNull(null); + assert.throws(function(){ + assert.isNull(undefined); + }); + assert.throws(function(){ + assert.isNull(false); + }); + }, + + 'assert.isUndefined()': function(){ + assert.isUndefined(undefined); + assert.throws(function(){ + assert.isUndefined(null); + }); + assert.throws(function(){ + assert.isUndefined(false); + }); + }, + + 'assert.isNotNull()': function(){ + assert.isNotNull(false); + assert.isNotNull(undefined); + assert.throws(function(){ + assert.isNotNull(null); + }); + }, + + 'assert.isDefined()': function(){ + assert.isDefined(false); + assert.isDefined(null); + assert.throws(function(){ + assert.isDefined(undefined); + }); + }, + + 'assert.match()': function(){ + assert.match('foobar', /foo(bar)?/); + assert.throws(function(){ + assert.match('something', /rawr/); + }); + }, + + 'assert.length()': function(){ + assert.length('test', 4); + assert.length([1,2,3,4], 4); + assert.throws(function(){ + assert.length([1,2,3], 4); + }); + } +}; \ No newline at end of file