-
Notifications
You must be signed in to change notification settings - Fork 189
Expand file tree
/
Copy pathutils.ts
More file actions
28 lines (26 loc) · 822 Bytes
/
utils.ts
File metadata and controls
28 lines (26 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import runServerlessFixtureEngine from '@serverless/test/setup-run-serverless-fixtures-engine';
import { merge } from 'lodash-es';
import path from 'path';
import Serverless from 'serverless';
type RunSlsOptions = {
fixture: 'appsync';
configExt?: Partial<Serverless['configurationInput']>;
awsRequestStubMap?: Record<string, Record<string, jest.Mock>>;
command: string;
options?: Record<string, string | boolean>;
};
export const runServerless = (options: RunSlsOptions) => {
return runServerlessFixtureEngine({
fixturesDir: path.resolve(__dirname, 'fixtures'),
serverlessDir: path.resolve(__dirname, '../../node_modules/serverless'),
})(
merge(
{
configExt: {
plugins: [path.resolve(__dirname, '../../src/index.ts')],
},
},
options,
),
);
};