Skip to content

Commit

Permalink
fix(server): load fixtures relatively from bin/server.js
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Nov 7, 2017
1 parent 3e1a894 commit ae9fb6a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin/serve.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#!/usr/bin/env node

const pathResolve = require('path').resolve

const express = require('express')
const glob = require('glob')
const nock = require('nock')
const proxy = require('http-proxy-middleware')

const fixturePaths = glob.sync('scenarios/api.github.com/*/normalized-fixture.json')
const fixturePaths = glob.sync(pathResolve(__dirname, '..', 'scenarios/api.github.com/*/normalized-fixture.json'))

fixturePaths.map(nock.load).forEach((fixtureMocks) => {
// by default, nock only allows each mocked route to be called once, afterwards
// it returns a "No match for request" error. mock.persist() works around that
Expand Down

0 comments on commit ae9fb6a

Please sign in to comment.