Skip to content

Instantly share code, notes, and snippets.

@jurek2006
jurek2006 / expect.extend.test.js
Created March 12, 2019 10:12
Expect - if object contains, if array contains, if array contains object
// Testing with mocha in Node it's enough just to create the file with ending *test.js
const expect = require('expect');
// custom matcher (https://medium.com/@andrei.pfeiffer/jest-matching-objects-in-array-50fe2f4d6b98)
// checks if array contains given object
expect.extend({
toContainObject(received, argument) {
const pass = this.equals(
received,
expect.arrayContaining([expect.objectContaining(argument)])
@jurek2006
jurek2006 / gist:8ae9688e1a77dc60ab06602e08db565c
Created May 16, 2018 02:33
mongo-db - uruchamianie w linuxie
#uruchamiam mongodb z danymi z folderu home /mongo-data
mongod --dbpath ~/mongo-data
#przykład
mongod --dbpath ~/PROGRAMOWANIE/mongo-data/