Skip to content

Commit 9b6469a

Browse files
authored
Merge branch 'PW-2436/Notification' into hotfix/copyright-header
2 parents b62e12d + 1a96f42 commit 9b6469a

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
@@ -27,22 +27,17 @@ module.exports = {
2727
"<rootDir>/src/typings"
2828
],
2929
setupFiles: ["<rootDir>config.ts", "dotenv/config"],
30-
unmockedModulePathPatterns: [
31-
"/dist"
32-
],
3330
testMatch: [
34-
"**/__tests__/*.ts"
35-
],
36-
testPathIgnorePatterns : [
37-
"/node_modules",
38-
"/dist"
31+
"**/src/__tests__/**/*.spec.ts"
3932
],
33+
roots: ['<rootDir>/src'],
4034
transform: {
4135
".ts": "ts-jest"
4236
},
4337
globals: {
4438
"ts-jest": {
45-
compiler: "ttypescript"
39+
compiler: "ttypescript",
40+
transformIgnorePatterns: ['^.+\\\\.js$']
4641
}
47-
}
42+
},
4843
};

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,18 +52,18 @@
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
"uglifyjs-webpack-plugin": "2.2.0",
6262
"webpack": "4.43.0",
6363
"webpack-cli": "3.3.11"
6464
},
6565
"dependencies": {
66-
"@types/node": "13.13.5",
66+
"@types/node": "14.0.5",
6767
"https-proxy-agent": "5.0.0"
6868
}
6969
}

src/__tests__/checkout.spec.ts

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

3232
const merchantAccount = process.env.ADYEN_MERCHANT!;
3333
const reference = "Your order number";
34+
const isCI = process.env.CI === "true" || (typeof process.env.CI === "boolean" && process.env.CI);
3435

3536
function createAmountObject(currency: string, value: number): ICheckout.Amount {
3637
return {
@@ -184,11 +185,8 @@ describe("Checkout", (): void => {
184185
expect(paymentSuccessLinkResponse).toBeTruthy();
185186
});
186187

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

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

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

src/__tests__/payout.spec.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import Client from "../client";
2424
import StoreDetailRequest = IPayouts.StoreDetailRequest;
2525
import {ApiConstants} from "../constants/apiConstants";
2626

27+
const isCI = process.env.CI === "true" || (typeof process.env.CI === "boolean" && process.env.CI);
2728
const storeDetailAndSubmitThirdParty = JSON.stringify({
2829
additionalData: {
2930
fraudResultType: "GREEN",
@@ -167,7 +168,7 @@ describe("PayoutTest", function (): void {
167168
expect(result.pspReference).toBeTruthy();
168169
});
169170

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

src/__tests__/recurring.spec.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const createRecurringDetailsRequest = (): IRecurring.RecurringDetailsRequest =>
3434
shopperReference: "shopperReference",
3535
};
3636
};
37+
const isCI = process.env.CI === "true" || (typeof process.env.CI === "boolean" && process.env.CI);
3738

3839
let client: Client;
3940
let recurring: Recurring;
@@ -69,7 +70,7 @@ describe("Recurring", (): void => {
6970
}
7071
});
7172

72-
test.each([false, true])("should disable, isMock: %p", async (isMock): Promise<void> => {
73+
test.each([isCI, true])("should disable, isMock: %p", async (isMock): Promise<void> => {
7374
!isMock && nock.restore();
7475
scope.post("/payments")
7576
.reply(200, paymentsSuccess);

0 commit comments

Comments
 (0)