Skip to content

Commit

Permalink
test: fix annotations tests
Browse files Browse the repository at this point in the history
  • Loading branch information
honzajavorek committed Apr 1, 2019
1 parent 80ca389 commit b967c6e
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions test/integration/annotations-test.js
Expand Up @@ -5,14 +5,9 @@ const Dredd = require('../../lib/Dredd');


function compileTransactions(apiDescription, logger, callback) {
const dredd = new Dredd({
apiDescriptions: [{
location: 'filename.api',
content: apiDescription,
}],
});
const dredd = new Dredd({ apiDescriptions: [apiDescription] });
dredd.logger = logger;
dredd.transactionRunner.run = (transactions, cb) => { cb(); };
dredd.transactionRunner.run = sinon.stub().callsArg(1);
dredd.run(callback);
}

Expand Down Expand Up @@ -40,7 +35,7 @@ FORMAT: 1A
it('logs the warnings with line numbers', () => {
assert.match(
logger.warn.getCall(0).args[0],
/^parser warning in 'filename\.api': [\s\S]+ on line 5$/i
/^parser warning in 'configuration\.apiDescriptions\[0\]': [\s\S]+ on line 5$/i
);
});
});
Expand Down Expand Up @@ -68,7 +63,7 @@ FORMAT: 1A
it('logs the errors with line numbers', () => {
assert.match(
logger.error.getCall(0).args[0],
/^parser error in 'filename\.api': [\s\S]+ on line 6$/i
/^parser error in 'configuration\.apiDescriptions\[0\]': [\s\S]+ on line 6$/i
);
});
});
Expand All @@ -95,7 +90,7 @@ FORMAT: 1A
it('logs the warnings with a transaction path', () => {
assert.match(
logger.warn.getCall(0).args[0],
/^compilation warning in 'filename\.api': [\s\S]+ \(Dummy API > Index > Index\)$/i
/^compilation warning in 'configuration\.apiDescriptions\[0\]': [\s\S]+ \(Dummy API > Index > Index\)$/i
);
});
});
Expand Down Expand Up @@ -124,7 +119,7 @@ FORMAT: 1A
it('logs the errors with a transaction path', () => {
assert.match(
logger.error.getCall(0).args[0],
/^compilation error in 'filename\.api': [\s\S]+ \(Dummy API > Index > Index\)$/i
/^compilation error in 'configuration\.apiDescriptions\[0\]': [\s\S]+ \(Dummy API > Index > Index\)$/i
);
});
});
Expand Down

0 comments on commit b967c6e

Please sign in to comment.