Skip to content

Commit

Permalink
fix(readme): fix example in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mefellows committed Aug 8, 2016
1 parent ea10a8d commit 1b86095
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,18 @@ More questions about what's involved in Pact? [Read more about it](http://docs.p
Check the `examples` folder for examples with Karma Jasmine / Mocha. The example below is taken from the [integration spec](https://github.com/pact-foundation/pact-js/blob/master/test/dsl/integration.spec.js).

```javascript
import path from 'path'
import { expect } from 'chai'
import Promise from 'bluebird'
import request from 'superagent'
import wrapper from '@pact-foundation/pact-node'

import { default as Pact } from 'pact'
var path = require('path')
var chai = require("chai")
var expect = chai.expect
var chaiAsPromised = require("chai-as-promised")
var Promise = require('bluebird')
var request = require ('superagent')
var wrapper = require('@pact-foundation/pact-node')
var Pact = require('pact')
chai.use(chaiAsPromised);

// great library to spin up the Pact Verifier Server
// that will record interactions and eventually validate your pacts
import wrapper from '@pact-foundation/pact-node'

describe('Pact', () => {

// when using the wrapper, you will need to tell it where to store the logs
Expand Down Expand Up @@ -129,15 +129,15 @@ describe('Pact', () => {
})

context('with a single request', () => {
it('successfully writes Pact file', (done) => {
describe('successfully writes Pact file', (done) => {

// add interactions, as many as needed
beforeEach((done) => {
provider.addInteraction({
state: 'i have a list of projects',
uponReceiving: 'a request for projects',
withRequest: {
method: 'get',
method: 'GET',
path: '/projects',
headers: { 'Accept': 'application/json' }
},
Expand All @@ -162,7 +162,6 @@ describe('Pact', () => {
.get('http://localhost:1234/projects')
.set({ 'Accept': 'application/json' })
.then(provider.verify)

expect(verificationPromise).to.eventually.eql(JSON.stringify(EXPECTED_BODY)).notify(done)
})
})
Expand Down

0 comments on commit 1b86095

Please sign in to comment.