Skip to content

Commit

Permalink
Fix references to getManifestData function`
Browse files Browse the repository at this point in the history
  • Loading branch information
srajiang committed Nov 11, 2022
1 parent 722bac7 commit 8467341
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/App-slack-function.spec.ts
Expand Up @@ -93,7 +93,7 @@ function withNoopAppMetadata(): Override {
export default function withMockValidManifestUtil(functionCallbackId: string): Override {
const mockManifestOutput = JSON.parse(`{"functions": {"${functionCallbackId}": {}}}`);
return {
'./cli/hook-utils/manifest': {
'./cli/hook-utils/get-manifest-data': {
getManifestData: () => mockManifestOutput,
},
};
Expand Down
6 changes: 3 additions & 3 deletions src/SlackFunction.spec.ts
Expand Up @@ -346,7 +346,7 @@ describe('SlackFunction utils', () => {
};
const getManifestSpy = sinon.spy(() => badManifestOutput);
const { findMatchingManifestDefinition } = await importSlackFunctionModule({
'./cli/hook-utils/manifest': {
'./cli/hook-utils/get-manifest-data': {
getManifestData: getManifestSpy,
},
});
Expand All @@ -363,7 +363,7 @@ describe('SlackFunction utils', () => {
},
};
const { findMatchingManifestDefinition } = await importSlackFunctionModule({
'./cli/hook-utils/manifest': {
'./cli/hook-utils/get-manifest-data': {
getManifestData: () => mockManifestOutput,
},
});
Expand All @@ -379,7 +379,7 @@ describe('SlackFunction utils', () => {
},
};
const { findMatchingManifestDefinition } = await importSlackFunctionModule({
'./cli/hook-utils/manifest': {
'./cli/hook-utils/get-manifest-data': {
getManifestData: () => mockManifestOutput,
},
});
Expand Down
4 changes: 3 additions & 1 deletion src/SlackFunction.ts
Expand Up @@ -24,6 +24,8 @@ import {

// eslint-disable-next-line
export const manifestUtil = require('./cli/hook-utils/manifest');
// eslint-disable-next-line
export const getManifestDataUtil = require('./cli/hook-utils/get-manifest-data');

/* Types */
export interface SlackFunctionExecutedMiddlewareArgs extends SlackEventMiddlewareArgs<'function_executed'> {
Expand Down Expand Up @@ -506,7 +508,7 @@ export function hasMatchingManifestDefinition(
export function findMatchingManifestDefinition(callbackId: string): ManifestDefinitionResult {
const result: ManifestDefinitionResult = { matchFound: false, fnKeys: [] };
// call the hook to get the manifest
const manifest = manifestUtil.getManifestData(process.cwd());
const manifest = getManifestDataUtil.getManifestData(process.cwd());

// manifest file must exist in the project
if (!('functions' in manifest)) {
Expand Down

0 comments on commit 8467341

Please sign in to comment.