Skip to content

Commit 73c7992

Browse files
authored
Merge pull request #1498 from Adyen/fix-test-headers
Use LibraryConstants values in unit tests
2 parents f05ee44 + 24c7a23 commit 73c7992

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/__tests__/httpClient.spec.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import { binlookup } from "../typings";
88
import { ApiConstants } from "../constants/apiConstants";
99
import {paymentMethodsSuccess} from "../__mocks__/checkout/paymentMethodsSuccess";
1010
import Config from "../config";
11+
import LibraryConstants from "../constants/libraryConstants";
12+
1113

1214
beforeEach((): void => {
1315
nock.cleanAll();
@@ -108,9 +110,9 @@ describe("HTTP Client", function (): void {
108110
const client = createClient();
109111
const checkout = new CheckoutAPI(client);
110112

111-
const expectedUserAgent = `adyen-node-api-library/26.1.0`;
112-
const expectedLibraryName = `adyen-node-api-library`;
113-
const expectedLibraryVersion = `26.1.0`;
113+
const expectedUserAgent = `${LibraryConstants.LIB_NAME}/${LibraryConstants.LIB_VERSION}`;
114+
const expectedLibraryName = LibraryConstants.LIB_NAME;
115+
const expectedLibraryVersion = LibraryConstants.LIB_VERSION;
114116

115117
const scope = nock("https://checkout-test.adyen.com/v71", {
116118
reqheaders: {
@@ -145,9 +147,9 @@ describe("HTTP Client", function (): void {
145147
client.config.applicationName = "testApp";
146148
const checkout = new CheckoutAPI(client);
147149

148-
const expectedUserAgent = `testApp adyen-node-api-library/26.1.0`; // include applicationName too
149-
const expectedLibraryName = `adyen-node-api-library`;
150-
const expectedLibraryVersion = `26.1.0`;
150+
const expectedUserAgent = `testApp ${LibraryConstants.LIB_NAME}/${LibraryConstants.LIB_VERSION}`; // include applicationName too
151+
const expectedLibraryName = LibraryConstants.LIB_NAME;
152+
const expectedLibraryVersion = LibraryConstants.LIB_VERSION;
151153

152154
const scope = nock("https://checkout-test.adyen.com/v71", {
153155
reqheaders: {

0 commit comments

Comments
 (0)