How to use the testdouble.config function in testdouble

To help you get started, we’ve selected a few testdouble examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hfreire / get-me-a-date / test / helper.js View on Github external
/*
 * Copyright (c) 2017, Hugo Freire .
 *
 * This source code is licensed under the license found in the
 * LICENSE.md file in the root directory of this source tree.
 */

const _ = require('lodash')
const Promise = require('bluebird')

const td = require('testdouble')
td.config({ promiseConstructor: Promise, ignoreWarnings: true })
require('testdouble-jest')(td, jest)

afterEach(() => td.reset())

global._ = _
global.Promise = Promise
global.td = td

td.replace('brakes') // TODO: https://github.com/jasmine/jasmine/issues/1469
github hfreire / browser-as-a-service / test / mocha.js View on Github external
/*
 * Copyright (c) 2017, Hugo Freire .
 *
 * This source code is licensed under the license found in the
 * LICENSE.md file in the root directory of this source tree.
 */

const Promise = require('bluebird')

const chai = require('chai')
chai.use(require('chai-as-promised'))
chai.config.includeStack = true

const td = require('testdouble')
td.config({
  promiseConstructor: Promise,
  ignoreWarnings: true
})

global.should = chai.should()
global.td = td
github hfreire / facebook-login-for-robots / test / mocha.js View on Github external
/*
 * Copyright (c) 2017, Hugo Freire .
 *
 * This source code is licensed under the license found in the
 * LICENSE.md file in the root directory of this source tree.
 */

const _ = require('lodash')
const Promise = require('bluebird')

const chai = require('chai')
chai.use(require('chai-as-promised'))
chai.config.includeStack = true

const td = require('testdouble')
td.config({
  promiseConstructor: Promise,
  ignoreWarnings: true
})

global._ = _
global.Promise = Promise
global.should = chai.should()
global.td = td
github bustle / shep / test-ava / helpers / testdouble.js View on Github external
import td from 'testdouble'
import Promise from 'bluebird'

td.config({ promiseConstructor: Promise, ignoreWarnings: true })

export default td