disable flaky e2e tests

This commit is contained in:
Ricardo Ambrogi
2020-05-12 08:17:18 +02:00
parent 4ebc4caa53
commit b48722a59f
3 changed files with 10 additions and 21 deletions

View File

@@ -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$']
}
}
},
};

View File

@@ -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 = {

View File

@@ -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);