Skip to content

Commit

Permalink
test: fix existing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardfoyle committed Jan 28, 2021
1 parent c8a3c55 commit d3a5f88
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ module.exports = {
'/packages/amplify-cli-logger/lib',
'/packages/amplify-codegen-appsync-model-plugin/lib',
'/packages/amplify-e2e-core/lib',
'/packages/amplify-function-plugin-interface/lib',
'/packages/amplify-graphql-docs-generator/lib',
'/packages/amplify-graphql-types-generator/lib',
'/packages/amplify-headless-interface/lib',
Expand All @@ -314,7 +315,7 @@ module.exports = {
'/packages/graphql-transformer-*/lib',
'/packages/amplify-headless-interface/lib',
'/packages/amplify-util-headless-input/lib',
'packages/amplify-graphql-*transformer*/lib',
'/packages/amplify-graphql-*transformer*/lib',
'/packages/amplify-provider-awscloudformation/lib',
'/packages/amplify-console-integration-tests/lib',

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import glob from 'glob';
import fs from 'fs-extra';
import _ from 'lodash';
import { buildResource } from '../../../src/utils/legacyBuild';
import { BuildType } from 'amplify-function-plugin-interface';

jest.mock('glob');
jest.mock('fs-extra');
Expand All @@ -27,8 +28,8 @@ describe('legacy build resource', () => {
const result = await buildResource({
lastBuildTimeStamp: new Date(timestamp),
srcRoot: 'resourceDir',
env: 'something',
runtime: 'other',
buildType: BuildType.PROD,
});

expect(result.rebuilt).toEqual(false);
Expand Down
5 changes: 5 additions & 0 deletions packages/amplify-util-mock/src/__tests__/func/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ jest.mock('amplify-cli-core', () => ({
pathManager: {
getBackendDirPath: () => 'fake-backend-path',
},
stateManager: {
getMeta: jest.fn().mockReturnValue({}),
},
}));
jest.mock('amplify-category-function', () => ({
getInvoker: () => () => new Promise(resolve => setTimeout(() => resolve('lambda value'), 1000 * 19)),
getBuilder: jest.fn().mockReturnValue(() => {}),
isMockable: () => ({ isMockable: true }),
category: 'function',
}));
Expand Down Expand Up @@ -44,6 +48,7 @@ describe('function start', () => {
success: jest.fn(),
info: jest.fn(),
error: jest.fn(),
warning: jest.fn(),
},
};

Expand Down

0 comments on commit d3a5f88

Please sign in to comment.