Skip to content

Commit 1a96f42

Browse files
authored
Merge branch 'develop' into PW-2436/Notification
2 parents 364da4f + 1f24e2a commit 1a96f42

File tree

8 files changed

+142
-181
lines changed

8 files changed

+142
-181
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
**Description**
2+
<!-- Please provide a description of the changes proposed in the Pull Request -->
3+
4+
**Tested scenarios**
5+
<!-- Description of tested scenarios -->
6+
7+
**Fixed issue**: <!-- #-prefixed issue number -->

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ client.httpClient = httpClient;
8989
```
9090

9191
## Support
92-
93-
If you have any problems, questions or suggestions, create an issue here or send your inquiry to [email protected].
92+
If you have a feature request, or spotted a bug or a technical problem, create a GitHub issue. For other questions, contact our [support team](https://support.adyen.com/hc/en-us/requests/new?ticket_form_id=360000705420).
9493

9594
## Contributing
9695
We strongly encourage you to join us in contributing to this repository so everyone can benefit from:

jest.config.js

+5-10
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,17 @@ module.exports = {
2929
"<rootDir>/src/typings"
3030
],
3131
setupFiles: ["<rootDir>config.ts", "dotenv/config"],
32-
unmockedModulePathPatterns: [
33-
"/dist"
34-
],
3532
testMatch: [
36-
"**/__tests__/*.ts"
37-
],
38-
testPathIgnorePatterns : [
39-
"/node_modules",
40-
"/dist"
33+
"**/src/__tests__/**/*.spec.ts"
4134
],
35+
roots: ['<rootDir>/src'],
4236
transform: {
4337
".ts": "ts-jest"
4438
},
4539
globals: {
4640
"ts-jest": {
47-
compiler: "ttypescript"
41+
compiler: "ttypescript",
42+
transformIgnorePatterns: ['^.+\\\\.js$']
4843
}
49-
}
44+
},
5045
};

package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@
3939
"author": "Ricardo Ambrogi",
4040
"license": "MIT",
4141
"devDependencies": {
42-
"@types/jest": "25.2.1",
42+
"@types/jest": "25.2.3",
4343
"@types/nock": "11.1.0",
44-
"@typescript-eslint/eslint-plugin": "2.31.0",
45-
"@typescript-eslint/parser": "2.31.0",
44+
"@typescript-eslint/eslint-plugin": "2.34.0",
45+
"@typescript-eslint/parser": "2.34.0",
4646
"acorn": "^7.1.1",
4747
"coveralls": "3.1.0",
4848
"dotenv": "^8.2.0",
@@ -52,17 +52,17 @@
5252
"kind-of": "^6.0.3",
5353
"minimist": ">=1.2.3",
5454
"nock": "12.0.3",
55-
"release-it": "13.5.8",
55+
"release-it": "13.6.1",
5656
"ts-auto-mock": "^1.6.0",
57-
"ts-jest": "25.5.0",
58-
"ts-loader": "7.0.2",
57+
"ts-jest": "25.5.1",
58+
"ts-loader": "7.0.4",
5959
"ttypescript": "^1.5.10",
60-
"typescript": "3.8.3",
60+
"typescript": "3.9.3",
6161
"webpack": "4.43.0",
6262
"webpack-cli": "3.3.11"
6363
},
6464
"dependencies": {
65-
"@types/node": "13.13.5",
65+
"@types/node": "14.0.5",
6666
"https-proxy-agent": "5.0.0"
6767
}
6868
}

src/__tests__/checkout.spec.ts

+5-10
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import HttpClientException from "../httpClient/httpClientException";
3333

3434
const merchantAccount = process.env.ADYEN_MERCHANT!;
3535
const reference = "Your order number";
36+
const isCI = process.env.CI === "true" || (typeof process.env.CI === "boolean" && process.env.CI);
3637

3738
function createAmountObject(currency: string, value: number): ICheckout.Amount {
3839
return {
@@ -186,11 +187,8 @@ describe("Checkout", (): void => {
186187
expect(paymentSuccessLinkResponse).toBeTruthy();
187188
});
188189

189-
test.each([false, true])("should have payment details, isMock: %p", async (isMock): Promise<void> => {
190-
if (!isMock) {
191-
console.warn("Cannot perform /payments/details without manual user validation. Skipping test.");
192-
return;
193-
}
190+
test.each([isCI, true])("should have payment details, isMock: %p", async (isMock): Promise<void> => {
191+
!isMock && nock.restore();
194192
scope.post("/payments/details")
195193
.reply(200, paymentDetailsSuccess);
196194

@@ -207,11 +205,8 @@ describe("Checkout", (): void => {
207205
expect(paymentSessionResponse.paymentSession).not.toBeUndefined();
208206
});
209207

210-
test.each([false, true])("should have payments result, isMock: %p", async (isMock): Promise<void> => {
211-
if (!isMock) {
212-
console.warn("Cannot perform /payments/result without payload. Skipping test.");
213-
return;
214-
}
208+
test.each([isCI, true])("should have payments result, isMock: %p", async (isMock): Promise<void> => {
209+
!isMock && nock.restore();
215210
scope.post("/payments/result")
216211
.reply(200, paymentsResultSuccess);
217212
const paymentResultRequest: ICheckout.PaymentVerificationRequest = {

src/__tests__/payout.spec.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Client from "../client";
55
import StoreDetailRequest = IPayouts.StoreDetailRequest;
66
import {ApiConstants} from "../constants/apiConstants";
77

8+
const isCI = process.env.CI === "true" || (typeof process.env.CI === "boolean" && process.env.CI);
89
const storeDetailAndSubmitThirdParty = JSON.stringify({
910
additionalData: {
1011
fraudResultType: "GREEN",
@@ -148,7 +149,7 @@ describe("PayoutTest", function (): void {
148149
expect(result.pspReference).toBeTruthy();
149150
});
150151

151-
test.each([false, true])("should succeed on submit third party, isMock: %p", async function (isMock): Promise<void> {
152+
test.each([isCI, true])("should succeed on submit third party, isMock: %p", async function (isMock): Promise<void> {
152153
!isMock && nock.restore();
153154
payout = new Payout(clientStore);
154155
scope.post("/submitThirdParty").reply(200, storeDetailAndSubmitThirdParty);

src/__tests__/recurring.spec.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const createRecurringDetailsRequest = (): IRecurring.RecurringDetailsRequest =>
1515
shopperReference: "shopperReference",
1616
};
1717
};
18+
const isCI = process.env.CI === "true" || (typeof process.env.CI === "boolean" && process.env.CI);
1819

1920
let client: Client;
2021
let recurring: Recurring;
@@ -50,7 +51,7 @@ describe("Recurring", (): void => {
5051
}
5152
});
5253

53-
test.each([false, true])("should disable, isMock: %p", async (isMock): Promise<void> => {
54+
test.each([isCI, true])("should disable, isMock: %p", async (isMock): Promise<void> => {
5455
!isMock && nock.restore();
5556
scope.post("/payments")
5657
.reply(200, paymentsSuccess);

0 commit comments

Comments
 (0)