mirror of
https://github.com/jlengrand/adyen-node-api-library.git
synced 2026-03-10 15:48:10 +00:00
disable flaky e2e tests
This commit is contained in:
@@ -29,22 +29,17 @@ module.exports = {
|
||||
"<rootDir>/src/typings"
|
||||
],
|
||||
setupFiles: ["<rootDir>config.ts", "dotenv/config"],
|
||||
unmockedModulePathPatterns: [
|
||||
"/dist"
|
||||
],
|
||||
testMatch: [
|
||||
"**/__tests__/*.ts"
|
||||
],
|
||||
testPathIgnorePatterns : [
|
||||
"/node_modules",
|
||||
"/dist"
|
||||
"**/src/__tests__/**/*.spec.ts"
|
||||
],
|
||||
roots: ['<rootDir>/src'],
|
||||
transform: {
|
||||
".ts": "ts-jest"
|
||||
},
|
||||
globals: {
|
||||
"ts-jest": {
|
||||
compiler: "ttypescript"
|
||||
compiler: "ttypescript",
|
||||
transformIgnorePatterns: ['^.+\\\\.js$']
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -33,6 +33,7 @@ import HttpClientException from "../httpClient/httpClientException";
|
||||
|
||||
const merchantAccount = process.env.ADYEN_MERCHANT!;
|
||||
const reference = "Your order number";
|
||||
const isCI = process.env.CI === "true" || (typeof process.env.CI === "boolean" && process.env.CI);
|
||||
|
||||
function createAmountObject(currency: string, value: number): ICheckout.Amount {
|
||||
return {
|
||||
@@ -186,11 +187,7 @@ describe("Checkout", (): void => {
|
||||
expect(paymentSuccessLinkResponse).toBeTruthy();
|
||||
});
|
||||
|
||||
test.each([false, true])("should have payment details, isMock: %p", async (isMock): Promise<void> => {
|
||||
if (!isMock) {
|
||||
console.warn("Cannot perform /payments/details without manual user validation. Skipping test.");
|
||||
return;
|
||||
}
|
||||
test.each([isCI, true])("should have payment details, isMock: %p", async (isMock): Promise<void> => {
|
||||
scope.post("/payments/details")
|
||||
.reply(200, paymentDetailsSuccess);
|
||||
|
||||
@@ -207,11 +204,7 @@ describe("Checkout", (): void => {
|
||||
expect(paymentSessionResponse.paymentSession).not.toBeUndefined();
|
||||
});
|
||||
|
||||
test.each([false, true])("should have payments result, isMock: %p", async (isMock): Promise<void> => {
|
||||
if (!isMock) {
|
||||
console.warn("Cannot perform /payments/result without payload. Skipping test.");
|
||||
return;
|
||||
}
|
||||
test.each([isCI, true])("should have payments result, isMock: %p", async (isMock): Promise<void> => {
|
||||
scope.post("/payments/result")
|
||||
.reply(200, paymentsResultSuccess);
|
||||
const paymentResultRequest: ICheckout.PaymentVerificationRequest = {
|
||||
|
||||
@@ -15,6 +15,7 @@ const createRecurringDetailsRequest = (): IRecurring.RecurringDetailsRequest =>
|
||||
shopperReference: "shopperReference",
|
||||
};
|
||||
};
|
||||
const isCI = process.env.CI === "true" || (typeof process.env.CI === "boolean" && process.env.CI);
|
||||
|
||||
let client: Client;
|
||||
let recurring: Recurring;
|
||||
@@ -50,7 +51,7 @@ describe("Recurring", (): void => {
|
||||
}
|
||||
});
|
||||
|
||||
test.each([false, true])("should disable, isMock: %p", async (isMock): Promise<void> => {
|
||||
test.each([isCI, true])("should disable, isMock: %p", async (isMock): Promise<void> => {
|
||||
!isMock && nock.restore();
|
||||
scope.post("/payments")
|
||||
.reply(200, paymentsSuccess);
|
||||
|
||||
Reference in New Issue
Block a user