Skip to content

Commit 4785112

Browse files
committed
style: fix lints
Signed-off-by: JP-Ellis <josh@jpellis.me>
1 parent 741bfda commit 4785112

File tree

10 files changed

+40
-0
lines changed

10 files changed

+40
-0
lines changed

src/common/request.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ describe('Request', () => {
3131
expect(r).to.be.fulfilled,
3232
]);
3333
});
34+
3435
it('resolves when request succeeds with response body', () => {
3536
const body = 'body';
3637
nock(url).get('/').reply(200, body);
@@ -40,6 +41,7 @@ describe('Request', () => {
4041
expect(p).to.eventually.be.equal(body),
4142
]);
4243
});
44+
4345
it('rejects when request fails with error message', () => {
4446
const error = 'error';
4547
nock(url).get('/').reply(400, error);

src/dsl/graphql.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ describe('GraphQLInteraction', () => {
3232
expect(json.request.body.operationName).to.eq('query');
3333
});
3434
});
35+
3536
describe('when given an invalid operation', () => {
3637
it('fails with an error', () => {
3738
expect(interaction.withOperation.bind('aoeu')).to.throw(Error);
3839
});
3940
});
41+
4042
describe('when given a null operation', () => {
4143
it('creates a GrphQL Interaction', () => {
4244
interaction.uponReceiving('a request');
@@ -79,6 +81,7 @@ describe('GraphQLInteraction', () => {
7981
expect(json.request.body.variables).to.deep.eq({ foo: 'bar' });
8082
});
8183
});
84+
8285
describe('when no variables are provided', () => {
8386
it('does not add the variables property to the payload', () => {
8487
interaction.uponReceiving('a request');
@@ -97,6 +100,7 @@ describe('GraphQLInteraction', () => {
97100
expect(json.request.body).to.not.have.property('variables');
98101
});
99102
});
103+
100104
describe('when an empty variables object is presented', () => {
101105
it('adds the variables property to the payload', () => {
102106
interaction.uponReceiving('a request');

src/dsl/interaction.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ describe('Interaction', () => {
2525
const actual = new Interaction().uponReceiving('r').given('').state;
2626
expect(actual).to.eql({ description: 'r' });
2727
});
28+
2829
it('creates Interaction when nothing is passed', () => {
2930
const actual = new Interaction().uponReceiving('r').state;
3031
expect(actual).to.eql({ description: 'r' });

src/dsl/matchers.spec.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ describe('Matcher', () => {
7171
like({ ...r });
7272
like(Object.freeze(f));
7373
});
74+
7475
it('compiles when InterfaceToTemplate is used', () => {
7576
const template: InterfaceToTemplate<ExampleInterface> = {
7677
someArray: ['one', 'two'],
@@ -85,6 +86,7 @@ describe('Matcher', () => {
8586
const unused: AnyTemplate = like(template);
8687
});
8788
});
89+
8890
describe('with types', () => {
8991
it('compiles', () => {
9092
const template: ExampleType = {
@@ -123,6 +125,7 @@ describe('Matcher', () => {
123125
);
124126
});
125127
});
128+
126129
describe('and a failing example', () => {
127130
it('returns false', () => {
128131
expect(validateExample('not a date', ISO8601_DATE_FORMAT)).to.eql(
@@ -131,6 +134,7 @@ describe('Matcher', () => {
131134
});
132135
});
133136
});
137+
134138
describe('when given an invalid regex', () => {
135139
it('returns an error', () => {
136140
expect(() => {
@@ -473,6 +477,7 @@ describe('Matcher', () => {
473477
expect(email()).to.be.an('object');
474478
});
475479
});
480+
476481
describe('when given an invalid Email address', () => {
477482
it('returns an error', () => {
478483
expect(() => {
@@ -489,6 +494,7 @@ describe('Matcher', () => {
489494
expect(uuid()).to.be.an('object');
490495
});
491496
});
497+
492498
describe('when given an invalid UUID', () => {
493499
it('returns an error', () => {
494500
expect(() => {
@@ -505,6 +511,7 @@ describe('Matcher', () => {
505511
expect(ipv4Address()).to.be.an('object');
506512
});
507513
});
514+
508515
describe('when given an invalid ipv4Address', () => {
509516
it('returns an error', () => {
510517
expect(() => {
@@ -524,6 +531,7 @@ describe('Matcher', () => {
524531
expect(ipv6Address()).to.be.an('object');
525532
});
526533
});
534+
527535
describe('when given an invalid ipv6Address', () => {
528536
it('returns an error', () => {
529537
expect(() => {
@@ -540,6 +548,7 @@ describe('Matcher', () => {
540548
expect(hexadecimal()).to.be.an('object');
541549
});
542550
});
551+
543552
describe('when given an invalid hexadecimal', () => {
544553
it('returns an error', () => {
545554
expect(() => {
@@ -555,10 +564,12 @@ describe('Matcher', () => {
555564
expect(boolean()).to.be.an('object');
556565
expect(boolean().value).to.equal(true);
557566
});
567+
558568
it('sets value=false', () => {
559569
expect(boolean(false)).to.be.an('object');
560570
expect(boolean(false).value).to.equal(false);
561571
});
572+
562573
it('sets value=true', () => {
563574
expect(boolean(true)).to.be.an('object');
564575
expect(boolean(true).value).to.equal(true);
@@ -606,6 +617,7 @@ describe('Matcher', () => {
606617
expect(rfc1123Timestamp()).to.be.an('object');
607618
});
608619
});
620+
609621
describe('when given an invalid rfc1123Timestamp', () => {
610622
it('returns an error', () => {
611623
expect(() => {
@@ -622,6 +634,7 @@ describe('Matcher', () => {
622634
expect(iso8601Time()).to.be.an('object');
623635
});
624636
});
637+
625638
describe('when given an invalid iso8601Time', () => {
626639
it('returns an error', () => {
627640
expect(() => {
@@ -638,6 +651,7 @@ describe('Matcher', () => {
638651
expect(iso8601Date()).to.be.an('object');
639652
});
640653
});
654+
641655
describe('when given an invalid iso8601Date', () => {
642656
it('returns an error', () => {
643657
expect(() => {
@@ -656,6 +670,7 @@ describe('Matcher', () => {
656670
expect(iso8601DateTime()).to.be.an('object');
657671
});
658672
});
673+
659674
describe('when given an invalid iso8601DateTime', () => {
660675
it('returns an error', () => {
661676
expect(() => {
@@ -683,6 +698,7 @@ describe('Matcher', () => {
683698
expect(iso8601DateTimeWithMillis()).to.be.an('object');
684699
});
685700
});
701+
686702
describe('when given an invalid iso8601DateTimeWithMillis', () => {
687703
it('returns an error', () => {
688704
expect(() => {
@@ -771,6 +787,7 @@ describe('Matcher', () => {
771787
expect(extractPayload(matcher)).to.eql(expected);
772788
});
773789
});
790+
774791
describe('when given a complex nested object with matchers', () => {
775792
it('removes all matching guff', () => {
776793
const o = somethingLike({

src/dsl/verifier/proxy/stateHandler/setupStates.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,15 @@ describe('#setupStates', () => {
7878
expect(executed).to.be.true;
7979
});
8080
});
81+
8182
describe('that do not return a value', () => {
8283
it('executes the handler and returns an empty Promise', async () => {
8384
await setupStates(state, opts);
8485

8586
expect(executed).to.be.true;
8687
});
8788
});
89+
8890
describe('that specify a setup and teardown function', () => {
8991
it('executes the lifecycle specific handler and returns any provider state injected values', async () => {
9092
const res = await setupStates(state2, opts);

src/httpPact/ffi.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ describe('Pact FFI', () => {
4949
expect(queryMock.calledWith('foo', 1, 'baz'));
5050
});
5151
});
52+
5253
describe('with single values', () => {
5354
it('calls the query ffi function for each value', () => {
5455
const queryMock = sinon.stub();
@@ -64,6 +65,7 @@ describe('Pact FFI', () => {
6465
expect(queryMock.calledWith('foo', 0, 'bar'));
6566
});
6667
});
68+
6769
describe('with array and single values', () => {
6870
it('calls the query ffi function for each value', () => {
6971
const queryMock = sinon.stub();

src/messageConsumerPact.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,15 @@ describe('MessageConsumer', () => {
4444
}).to.throw(Error);
4545
});
4646
});
47+
4748
describe('when an empty content object has been given', () => {
4849
it('it should throw an error', () => {
4950
expect(() => {
5051
consumer.withContent({});
5152
}).to.throw(Error);
5253
});
5354
});
55+
5456
describe('when an empty metadata object has been given', () => {
5557
it('it should throw an error', () => {
5658
expect(() => {
@@ -96,6 +98,7 @@ describe('MessageConsumer', () => {
9698
return expect(hFn(testMessage)).to.eventually.be.fulfilled;
9799
});
98100
});
101+
99102
describe('when given a function that throws an Exception', () => {
100103
it('returns a Handler object that returns a rejected promise', () => {
101104
const failFn = () => Promise.reject(new Error('fail'));

src/messageProviderPact.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ describe('MesageProvider', () => {
5858
expect(provider).to.be.a('object');
5959
expect(provider).to.respondTo('verify');
6060
});
61+
6162
it('creates a Provider with default log level if not specified', () => {
6263
provider = new MessageProviderPact({
6364
messageProviders: {},
@@ -82,6 +83,7 @@ describe('MesageProvider', () => {
8283
setupVerificationHandler(req, res);
8384
});
8485
});
86+
8587
describe('when their is an invalid setup', () => {
8688
it('creates a valid express handler that rejects the message', (done) => {
8789
const setupVerificationHandler = (
@@ -112,6 +114,7 @@ describe('MesageProvider', () => {
112114
);
113115
});
114116
});
117+
115118
describe('when given a handler that does not exist', () => {
116119
it('returns a failed promise', () => {
117120
const findHandler = (provider as any).findHandler.bind(provider);
@@ -128,6 +131,7 @@ describe('MesageProvider', () => {
128131
'yay',
129132
]);
130133
});
134+
131135
it('passes params to the handler', () => {
132136
const setupStates = (provider as any).setupStates.bind(provider);
133137
return expect(
@@ -141,6 +145,7 @@ describe('MesageProvider', () => {
141145
]);
142146
});
143147
});
148+
144149
describe('when given a state that does not have a handler', () => {
145150
it('returns an empty promise', () => {
146151
provider = new MessageProviderPact({
@@ -164,6 +169,7 @@ describe('MesageProvider', () => {
164169
});
165170
});
166171
});
172+
167173
describe('#setupProxyServer', () => {
168174
describe('when the http server starts up', () => {
169175
it('returns a resolved promise', () => {
@@ -173,6 +179,7 @@ describe('MesageProvider', () => {
173179
});
174180
});
175181
});
182+
176183
describe('#setupProxyApplication', () => {
177184
it('returns a valid express app', () => {
178185
const setupProxyApplication = (

src/v3/matchers.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,7 @@ describe('V3 Matchers', () => {
643643
expect(MatchersV3.reify(matcher)).to.eql(expected);
644644
});
645645
});
646+
646647
describe('when given a complex nested object with matchers', () => {
647648
it('removes all matching guff', () => {
648649
const o = MatchersV3.like({

src/v3/xml/xmlElement.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ describe('xml element', () => {
8585
expect(child.matcher?.['pact:matcher:type']).not.to.be.empty;
8686
}
8787
});
88+
8889
it('sets content to an empty string if the Matcher has no value', () => {
8990
function noValueMatcher(): Matcher<string> {
9091
return {

0 commit comments

Comments
 (0)