Skip to content

Instantly share code, notes, and snippets.

@lmiller1990
Created April 28, 2018 12:56
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 lmiller1990/9432684bd15704d5e4aa5554b4b86aed to your computer and use it in GitHub Desktop.
Save lmiller1990/9432684bd15704d5e4aa5554b4b86aed to your computer and use it in GitHub Desktop.
const {
describe,
it,
expect,
matchers
} = require('./index')
let executes = 0
const noop = () => { executes += 1 }
describe('describe', () => {
it('returns a function', () => {
const actual = describe('', noop)
expect(executes).toBe(1)
})
})
describe('expect', () => {
it('returns an object', () => {
const actual = expect(true)
expect(typeof actual).toBe('object')
expect(typeof actual.toBe).toBe('function')
})
})
describe('matchers', () => {
describe('toBe', () => {
it('works', () => {
const actual = matchers('1').toBe('1')
expect(actual).toBe(true)
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment