This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { getReturnItem } from "./getReturnItem"; | |
| import { ReturnItem } from "../Type/ReturnItem"; | |
| import { | |
| awsSdkPromiseResponse, | |
| DocumentClient, | |
| GetItemInput, | |
| } from "../../../__mocks__/aws-sdk/clients/dynamodb"; | |
| jest.mock("../../../__mocks__/aws-sdk/clients/dynamodb"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as AWSMock from "aws-sdk-mock"; | |
| import { DocumentClient, GetItemInput } from "aws-sdk/clients/dynamodb"; | |
| import * as AWS from "aws-sdk"; | |
| import { ReturnItem } from "../Type/ReturnItem"; | |
| import { getReturnItem } from "./getReturnItem"; | |
| describe("Get Return Item from dynamodb", () => { | |
| describe("unit", () => { | |
| beforeAll(() => { | |
| process.env.tablename = "dummyTableName"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const awsSdkPromiseResponse = jest.fn().mockReturnValue(Promise.resolve(true)); | |
| const getFn = jest.fn().mockImplementation(() => ({ promise: awsSdkPromiseResponse })); | |
| export class DocumentClient { | |
| get = getFn; | |
| } | |
| export interface GetItemInput { | |
| TableName: string; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const awsSdkPromiseResponse = jest.fn().mockReturnValue(Promise.resolve(true)); | |
| const getFn = jest.fn().mockImplementation(() => ({ promise: awsSdkPromiseResponse })); | |
| export class DocumentClient { | |
| get = getFn; | |
| } | |
| export interface GetItemInput { | |
| TableName: string; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| delay: (ms: number) => Promise<void> = function(ms: number) { | |
| return new Promise<void>(resolve => setTimeout(resolve, ms); | |
| } | |
| delayWithArrowFunction: (ms: number) => Promise<void> = (ms: number) => | |
| new Promise<void>(resolve => setTimeout(resolve, ms); | |
| getStringArray: () => Promise<string[]> = function() { | |
| new Promise<string[]>((resolve) => { | |
| resolve(['a','b','c']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| getDataAfterADelay(1500, function(data) { | |
| data.forEach((item, i, arrayOfStrings) => console.log(`${item} is the ${i} th item out of ${arrayOfStrings.length}); | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface callbackfnInterface { | |
| (data: string[]): void; | |
| } | |
| export function getDataAfterADelay( | |
| delayMs: number, | |
| callbackfn: callbackfnInterface, | |
| ) { | |
| setTimeout(() => { | |
| const data = ['1','d','3']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '3.1' | |
| services: | |
| localstack: | |
| image: localstack/localstack:latest | |
| environment: | |
| - AWS_DEFAULT_REGION=us-east-1 | |
| - EDGE_PORT=4566 | |
| - SERVICES=lambda,s3,cloudformation,sts | |
| ports: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: microservices-returnsportal-service | |
| labels: | |
| app: microservices-returnsportal-service | |
| spec: | |
| replicas: 1 | |
| selector: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ranjani.venkataraman@MacBook-Pro ~/Sites/MG-Platform-LDE feature/LDE-284-magento-rp-skaffold-ranjani ● ⍟6 time ./mg php:n98 sys:cron:run sitemap_generate | |
| It's not recommended to run n98-magerun as root user | |
| Run Mage_Sitemap_Model_Observer::scheduledGenerateSitemaps done | |
| ./mg php:n98 sys:cron:run sitemap_generate 0.52s user 0.89s system 1% cpu 1:11.35 total | |
| ranjani.venkataraman@MacBook-Pro ~/Sites/MG-Platform-LDE feature/LDE-284-magento-rp-skaffold-ranjani ● ⍟6 time ./mg php:n98 sys:cron:run sitemap_generate | |
| It's not recommended to run n98-magerun as root user |