Skip to content

Instantly share code, notes, and snippets.

@aaronash
Created August 8, 2016 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronash/ab79fec63f44f4c98d0a6ee9f348c4eb to your computer and use it in GitHub Desktop.
Save aaronash/ab79fec63f44f4c98d0a6ee9f348c4eb to your computer and use it in GitHub Desktop.
$ cd node_modules/baucis
$ npm install
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated to-iso-string@0.0.2: to-iso-string has been deprecated, use @segment/to-iso-string instead.
npm WARN deprecated jade@0.26.3: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
baucis@1.6.5 /Users/ash/node/2016/baucistest/node_modules/baucis
├── async@0.9.2
├─┬ baucis-json@1.0.0
│ └── event-stream@3.2.2
├── baucis-links@1.0.1
├─┬ body-parser@1.15.2
│ ├── bytes@2.4.0
│ ├── content-type@1.0.2
│ ├─┬ debug@2.2.0
│ │ └── ms@0.7.1
│ ├── depd@1.1.0
│ ├─┬ http-errors@1.5.0
│ │ ├── inherits@2.0.1
│ │ ├── setprototypeof@1.0.1
│ │ └── statuses@1.3.0
│ ├── iconv-lite@0.4.13
│ ├─┬ on-finished@2.3.0
│ │ └── ee-first@1.1.1
│ ├── qs@6.2.0
│ ├─┬ raw-body@2.1.7
│ │ └── unpipe@1.0.0
│ └─┬ type-is@1.6.13
│ └── media-typer@0.3.0
├─┬ deco@0.12.3
│ └── requireindex@1.1.0
├─┬ event-stream@3.3.4
│ ├── duplexer@0.1.1
│ ├── from@0.1.3
│ ├── map-stream@0.1.0
│ ├── pause-stream@0.0.11
│ ├── split@0.3.3
│ └── stream-combiner@0.0.4
├── expect.js@0.3.1
├── UNMET PEER DEPENDENCY express@^4.12.0
├─┬ istanbul@0.3.22
│ ├── abbrev@1.0.9
│ ├── async@1.5.2
│ ├─┬ escodegen@1.7.1
│ │ ├── esprima@1.2.5
│ │ ├── estraverse@1.9.3
│ │ ├── esutils@2.0.2
│ │ ├─┬ optionator@0.5.0
│ │ │ ├── deep-is@0.1.3
│ │ │ ├── fast-levenshtein@1.0.7
│ │ │ ├── levn@0.2.5
│ │ │ ├── prelude-ls@1.1.2
│ │ │ ├── type-check@0.3.2
│ │ │ └── wordwrap@0.0.3
│ │ └─┬ source-map@0.2.0
│ │ └── amdefine@1.0.0
│ ├── esprima@2.5.0
│ ├─┬ fileset@0.2.1
│ │ ├─┬ glob@5.0.15
│ │ │ ├── inflight@1.0.5
│ │ │ └── path-is-absolute@1.0.0
│ │ └─┬ minimatch@2.0.10
│ │ └─┬ brace-expansion@1.1.6
│ │ ├── balanced-match@0.4.2
│ │ └── concat-map@0.0.1
│ ├─┬ handlebars@4.0.5
│ │ ├── async@1.5.2
│ │ ├─┬ optimist@0.6.1
│ │ │ ├── minimist@0.0.10
│ │ │ └── wordwrap@0.0.3
│ │ ├── source-map@0.4.4
│ │ └─┬ uglify-js@2.7.0
│ │ ├── async@0.2.10
│ │ ├── source-map@0.5.6
│ │ ├── uglify-to-browserify@1.0.2
│ │ └─┬ yargs@3.10.0
│ │ ├── camelcase@1.2.1
│ │ ├─┬ cliui@2.1.0
│ │ │ ├─┬ center-align@0.1.3
│ │ │ │ ├─┬ align-text@0.1.4
│ │ │ │ │ ├─┬ kind-of@3.0.4
│ │ │ │ │ │ └── is-buffer@1.1.4
│ │ │ │ │ ├── longest@1.0.1
│ │ │ │ │ └── repeat-string@1.5.4
│ │ │ │ └── lazy-cache@1.0.4
│ │ │ ├── right-align@0.1.3
│ │ │ └── wordwrap@0.0.2
│ │ ├── decamelize@1.2.0
│ │ └── window-size@0.1.0
│ ├─┬ js-yaml@3.6.1
│ │ ├─┬ argparse@1.0.7
│ │ │ └── sprintf-js@1.0.3
│ │ └── esprima@2.7.2
│ ├─┬ mkdirp@0.5.1
│ │ └── minimist@0.0.8
│ ├── nopt@3.0.6
│ ├─┬ once@1.3.3
│ │ └── wrappy@1.0.2
│ ├── resolve@1.1.7
│ ├─┬ supports-color@3.1.2
│ │ └── has-flag@1.0.0
│ ├─┬ which@1.2.10
│ │ └── isexe@1.1.2
│ └── wordwrap@1.0.0
├─┬ mocha@2.5.3
│ ├── commander@2.3.0
│ ├── diff@1.4.0
│ ├── escape-string-regexp@1.0.2
│ ├─┬ glob@3.2.11
│ │ └─┬ minimatch@0.3.0
│ │ ├── lru-cache@2.7.3
│ │ └── sigmund@1.0.1
│ ├── growl@1.9.2
│ ├─┬ jade@0.26.3
│ │ ├── commander@0.6.1
│ │ └── mkdirp@0.3.0
│ ├── supports-color@1.2.0
│ └── to-iso-string@0.0.2
├── UNMET PEER DEPENDENCY mongoose@>=3 <5
├── parse-links@0.1.0
├─┬ passport@0.2.2
│ ├── passport-strategy@1.0.0
│ └── pause@0.0.1
├── passport-local@1.0.0
├─┬ request@2.74.0
│ ├── aws-sign2@0.6.0
│ ├── aws4@1.4.1
│ ├─┬ bl@1.1.2
│ │ └─┬ readable-stream@2.0.6
│ │ ├── core-util-is@1.0.2
│ │ ├── isarray@1.0.0
│ │ ├── process-nextick-args@1.0.7
│ │ ├── string_decoder@0.10.31
│ │ └── util-deprecate@1.0.2
│ ├── caseless@0.11.0
│ ├─┬ combined-stream@1.0.5
│ │ └── delayed-stream@1.0.0
│ ├── extend@3.0.0
│ ├── forever-agent@0.6.1
│ ├─┬ form-data@1.0.0-rc4
│ │ └── async@1.5.2
│ ├─┬ har-validator@2.0.6
│ │ ├─┬ chalk@1.1.3
│ │ │ ├── ansi-styles@2.2.1
│ │ │ ├─┬ has-ansi@2.0.0
│ │ │ │ └── ansi-regex@2.0.0
│ │ │ ├── strip-ansi@3.0.1
│ │ │ └── supports-color@2.0.0
│ │ ├─┬ commander@2.9.0
│ │ │ └── graceful-readlink@1.0.1
│ │ ├─┬ is-my-json-valid@2.13.1
│ │ │ ├── generate-function@2.0.0
│ │ │ ├─┬ generate-object-property@1.2.0
│ │ │ │ └── is-property@1.0.2
│ │ │ ├── jsonpointer@2.0.0
│ │ │ └── xtend@4.0.1
│ │ └─┬ pinkie-promise@2.0.1
│ │ └── pinkie@2.0.4
│ ├─┬ hawk@3.1.3
│ │ ├── boom@2.10.1
│ │ ├── cryptiles@2.0.5
│ │ ├── hoek@2.16.3
│ │ └── sntp@1.0.9
│ ├─┬ http-signature@1.1.1
│ │ ├── assert-plus@0.2.0
│ │ ├─┬ jsprim@1.3.0
│ │ │ ├── extsprintf@1.0.2
│ │ │ ├── json-schema@0.2.2
│ │ │ └── verror@1.3.6
│ │ └─┬ sshpk@1.9.2
│ │ ├── asn1@0.2.3
│ │ ├── assert-plus@1.0.0
│ │ ├─┬ dashdash@1.14.0
│ │ │ └── assert-plus@1.0.0
│ │ ├── ecc-jsbn@0.1.1
│ │ ├─┬ getpass@0.1.6
│ │ │ └── assert-plus@1.0.0
│ │ ├── jodid25519@1.0.2
│ │ ├── jsbn@0.1.0
│ │ └── tweetnacl@0.13.3
│ ├── is-typedarray@1.0.0
│ ├── isstream@0.1.2
│ ├── json-stringify-safe@5.0.1
│ ├─┬ mime-types@2.1.11
│ │ └── mime-db@1.23.0
│ ├── node-uuid@1.4.7
│ ├── oauth-sign@0.8.2
│ ├── stringstream@0.0.5
│ ├── tough-cookie@2.3.1
│ └── tunnel-agent@0.4.3
├── rest-error@1.3.1
├── semver@4.3.6
└── through@2.3.8
npm WARN baucis@1.6.5 requires a peer of express@^4.12.0 but none was installed.
npm WARN baucis@1.6.5 requires a peer of mongoose@>=3 <5 but none was installed.
$ npm test
> baucis@1.6.5 test /Users/ash/node/2016/baucistest/node_modules/baucis
> mocha --bail
Controllers
(node:55680) DeprecationWarning: Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html
✓ should allow passing string name to create
✓ should allow passing a model to create
✓ should not allow leaving off arguments to create
✓ should not allow weird arguments to create
✓ should have methods set by default
(node:55680) DeprecationWarning: Mongoose: Query.prototype.stream() is deprecated in mongoose >= 4.5.0, use Query.prototype.cursor() instead
✓ should support select options for GET requests (84ms)
✓ should allow deselecting
✓ should allow deselecting hyphenated field names
✓ should support select options for POST requests
✓ should support select options for PUT requests (45ms)
✓ should allow POSTing when fields are deselected (issue #67)
✓ should support finding documents with custom findBy field
✓ should disallow adding a non-unique findBy field
✓ should allow adding a uniqe findBy field 1
✓ should allow adding a unique findBy field 2
✓ should allow adding arbitrary routes
✓ should allow adding arbitrary routes with params
✓ should still allow using baucis routes when adding arbitrary routes
✓ should allow using middleware
✓ should allow using middleware mounted at a path
✓ should disallow unrecognized verbs
✓ should disallow unrecognized howManys
✓ should allow specifying instance or collection middleware
✓ should allow registering query middleware for other verbs
✓ should allow registering POST middleware for other stages
✓ should correctly set the deselected paths property
✓ should disallow push mode by default
✓ should disallow pushing to non-whitelisted paths
✓ should allow pushing to an instance document's whitelisted arrays when $push mode is enabled
✓ should disallow $pull mode by default
✓ should disallow pulling non-whitelisted paths
✓ should allow pulling from an instance document's whitelisted arrays when $pull mode is enabled
✓ should disallow push mode by default
✓ should disallow setting non-whitelisted paths
✓ should allow setting an instance document's whitelisted paths when $set mode is enabled
✓ should allow pushing to embedded arrays using positional $
✓ should allow setting embedded fields using positional $
✓ should allow pulling from embedded fields using positional $
✓ should send 405 when a verb is disabled (GET)
✓ should send 405 when a verb is disabled (DELETE)
✓ should return a 400 when ID malformed (not ObjectID)
✓ should return a 400 when ID malformed (not Number)
✓ should allow setting path different from model name
✓ should allow setting model independently of name
1) should handle unique key error as a validation error
44 passing (2s)
1 failing
1) Controllers should handle unique key error as a validation error:
Uncaught Error: expected { message: 'Path `???` (???) must be unique.',
originalMessage: 'E11000 duplicate key error collection: yYyBaUcIsTeStYyY.cheeses index: name_1 dup key: { : "Gorgonzola" }',
name: 'MongoError',
path: '???',
type: 'unique',
value: '???' } to have a property 'message' of 'Path `name` (Gorgonzola) must be unique.', but got 'Path `???` (???) must be unique.'
at Assertion.assert (node_modules/expect.js/index.js:96:13)
at Assertion.property (node_modules/expect.js/index.js:388:12)
at Request._callback (test/controllers.js:599:33)
at Request.self.callback (node_modules/request/request.js:187:22)
at Request.<anonymous> (node_modules/request/request.js:1044:10)
at IncomingMessage.<anonymous> (node_modules/request/request.js:965:12)
at endReadableNT (_stream_readable.js:975:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)
npm ERR! Test failed. See above for more details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment