Skip to content

Commit e2ce2b4

Browse files
committed
fix: TODOs
1 parent eeb9975 commit e2ce2b4

5 files changed

Lines changed: 8 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Drop support for Node 12, 13, 14, and 15
66
- Adds `webhook_secret` and `custom_headers` properties to Typescript definitions of a Webhook
7+
- `findMatchingMockRequest` mocking function made private
78
- Removes undocumented and unmaintained `repl`
89
- Bumps dependencies
910

test/helpers/mocking.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class MockMiddleware {
3434
// eslint-disable-next-line class-methods-use-this,no-unused-vars,consistent-return
3535
send(body) {
3636
// we don't need to do anything with the body
37-
const mockRequest = this.findMatchingMockRequest(this.request);
37+
const mockRequest = this._findMatchingMockRequest(this.request);
3838
if (mockRequest) {
3939
this.body = mockRequest.responseInfo.body;
4040
return mockRequest.responseInfo;
@@ -45,16 +45,18 @@ export class MockMiddleware {
4545
// eslint-disable-next-line no-unused-vars
4646
query(params) {
4747
// we don't need to do anything with the params
48-
const mockRequest = this.findMatchingMockRequest(this.request);
48+
const mockRequest = this._findMatchingMockRequest(this.request);
4949
if (mockRequest) {
5050
this.body = mockRequest.responseInfo.body;
5151
return mockRequest.responseInfo;
5252
}
5353
return {};
5454
}
5555

56-
// TODO: Make private in the future
57-
findMatchingMockRequest(request) {
56+
/**
57+
* @private
58+
*/
59+
_findMatchingMockRequest(request) {
5860
// for each mock request, check if the method and url match
5961
for (let i = 0; i < this.mockRequests.length; i += 1) {
6062
const mockRequest = this.mockRequests[i];

test/services/address.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ describe('Address Service', function () {
4747

4848
// Delivery verification assertions
4949
expect(address.verifications.delivery.success).to.be.false;
50-
// TODO: details is not deserializing correctly, related to the larger "double EasyPostObject" wrapping issue
51-
// expect(address.verifications.delivery.details).to.equal({});
50+
expect(address.verifications.delivery.details).to.not.be.null;
5251
expect(address.verifications.delivery.errors[0].code).to.equal('E.ADDRESS.NOT_FOUND');
5352
expect(address.verifications.delivery.errors[0].field).to.equal('address');
5453
expect(address.verifications.delivery.errors[0].suggestion).to.be.null;

types/PaymentMethod/PaymentMethod.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import { IObjectWithId } from '../base';
22

33
/**
44
* The Payment method object can be either credit card or bank account.
5-
*
6-
* TODO: Add the link to the API doc once its updated
75
*/
86
export declare interface IPaymentMethod extends IObjectWithId<'PaymentMethod'> {
97
/**

types/errors/ErrorCode.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// TODO: there seems to be a lot of duplicate codes listed here https://www.easypost.com/errors-guide
21
export declare type TErrorCode =
32
| 'ADDRESS.COUNTRY.INVALID'
43
| 'ADDRESS.PARAMETERS.INVALID_CHARACTER'

0 commit comments

Comments
 (0)