mjackson/then-redis

View on GitHub
modules/__tests__/set-test.js

Summary

Maintainability
A
3 hrs
Test Coverage
import expect from 'expect'
import db from './db'

describe('set', () => {
  let key, expectedReply
  beforeEach(() => {
    key = 'a-key'
    expectedReply = 'hello world'
    return db.set(key, expectedReply)
  })

  it('sets the value of a key', () =>
    db.get(key).then((reply) => {
      expect(reply).toBe(expectedReply)
    })
  )
})