New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

ognom

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ognom

Ognom.

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
4
-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

ognom npm npm

Real Fake MongoDB for NodeJS

Installation

yarn add ognom --dev

Usage

import {Ognom} from "ognom"


let db
before(async () => {
  const ognom = new Ognom()
  db = await ognom.connect()
})
after(async () => {
  await db.dropDatabase()
})
describe("Ognom", () => {
  it('insertOne', async () => {
    const x = await db.collection("foo").insertOne({cool: true})
    expect(x.result).to.deep.equal({n: 1, ok: 1})
  })
 
  it("findOne", async () => {
    const x = await db.collection("foo").findOne({cool: true})
    expect(x._id instanceof ObjectID).equals(true)
    expect(x._id.toHexString()).to.be.a("string")
    expect(x.cool).equals(true)
  })
  
  it("findOneAndUpdate", async () => {
    const x = await db.collection("foo").findOneAndUpdate({cool: true}, {$set: {cool: false}})
    const y = await db.collection("foo").findOne({cool: false})
    expect(x.ok).equals(1)
    expect(y._id instanceof ObjectID).equals(true)
    expect(y._id.toHexString()).to.be.a("string")
    expect(y.cool).equals(false)
  })
})

Keywords

mongodb

FAQs

Package last updated on 12 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts