Skip to content

Commit

Permalink
refactor: remove support for legacy 'blueprintPath' config option
Browse files Browse the repository at this point in the history
BREAKING CHANGE: If you are running Dredd programatically using its JS API and you're setting the 'blueprintPath' option, use the 'path' option instead.
  • Loading branch information
honzajavorek committed Jan 11, 2019
1 parent 4066e2e commit 4e5b6c6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 36 deletions.
6 changes: 0 additions & 6 deletions lib/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ function applyLoggingOptions(options) {

function applyConfiguration(config) {
const configuration = {
blueprintPath: null,
server: null,
emitter: new EventEmitter(),
hooksCode: null,
Expand Down Expand Up @@ -95,11 +94,6 @@ function applyConfiguration(config) {
configuration.options.only = coerceToArray(configuration.options.only);
configuration.options.path = coerceToArray(configuration.options.path);

// Support for legacy JS API options
if (config.blueprintPath) {
configuration.options.path.push(config.blueprintPath);
}

configuration.options.method = configuration.options.method.map(method => method.toUpperCase());

if (configuration.options.user) {
Expand Down
30 changes: 0 additions & 30 deletions test/unit/Dredd-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,6 @@ describe('Dredd class', () => {

afterEach(() => fsStub.readFile.restore());

describe('with legacy configuration', () => {
before(() => {
configuration = {
server: 'http://127.0.0.1:3000/',
blueprintPath: './test/fixtures/apiary.apib',
};
sinon.stub(loggerStub, 'info').callsFake(() => { });
sinon.stub(loggerStub, 'log').callsFake(() => { });
});

after(() => {
loggerStub.info.restore();
loggerStub.log.restore();
});

it('should not explode and run executeTransaction', (done) => {
function fn() {
dredd = new Dredd(configuration);
sinon.stub(dredd.runner, 'executeTransaction').callsFake((transaction, hooks, callback) => callback());
dredd.run(() => {
assert.isOk(dredd.runner.executeTransaction.called);
dredd.runner.executeTransaction.restore();
done();
});
}

assert.doesNotThrow(fn);
});
});

describe('with valid configuration', () => {
before(() => {
configuration = {
Expand Down

0 comments on commit 4e5b6c6

Please sign in to comment.