Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
suite.on('pre-require', function (context, file, mocha) {
var common = require('mocha/lib/interfaces/common')(suites, context)
context.beforeEach = common.beforeEach
context.afterEach = common.afterEach
context.run = mocha.options.delay && common.runWithSuite(suite)
var mockServer = wrapper.create({
port: 1234,
log: path.resolve(process.cwd(), 'logs', 'mockserver.log'),
dir: path.resolve(process.cwd(), 'pacts'),
spec: 2
})
context.Pact = function (consumer, provider, providerURL, fn) {
var pactSuite = Suite.create(suites[0], `Pact ${consumer} <=> ${provider}`)
pactSuite.file = file
pactSuite.pactConsumer = consumer
pactSuite.pactProvider = provider
pactSuite.pact = Pact.Verifier({ consumer: consumer, provider: provider })
suites.unshift(pactSuite)
suite.on('pre-require', (context, file, mocha) => {
var common = require('mocha/lib/interfaces/common')(suites, context)
context.run = mocha.options.delay && common.runWithSuite(suite)
const mockServer = wrapper.create({
port: 1234,
log: path.resolve(process.cwd(), 'logs', 'mockserver.log'),
dir: path.resolve(process.cwd(), 'pacts'),
spec: 2
})
context.Pact = (consumer, provider, providerURL, fn) => {
const pactSuite = Suite.create(suites[0], `Pact ${consumer} <=> ${provider}`)
pactSuite.file = file
pactSuite.pactConsumer = consumer
pactSuite.pactProvider = provider
pactSuite.pact = Pact({ consumer, provider })
pactSuite.pact.intercept(providerURL)