Skip to content

Commit ec81a7a

Browse files
author
Alice
committed
added test files to ts check
1 parent 8bfe3e9 commit ec81a7a

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

src/__tests__/build.test.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,19 @@ describe('build.js', () => {
1515
console.log(res);
1616
expect(res).toBeUndefined();
1717
} catch (err) {
18-
console.log(err);
19-
expect(err.message).toEqual('Function "FirstLambda" does not presented in serverless manifest');
18+
expect((err as Error).message).toEqual('Function "FirstLambda" does not presented in serverless manifest');
2019
}
2120
});
2221

2322
it('should not throw err', async () => {
24-
const SFOP = new StepFunctionsOfflinePlugin(serverless, {
25-
...global['options'],
26-
location: '/src/__tests__',
27-
});
23+
const SFOP = new StepFunctionsOfflinePlugin(
24+
serverless,
25+
{
26+
...global['options'],
27+
location: '/src/__tests__',
28+
},
29+
logging
30+
);
2831
SFOP.variables = { FirstLambda: 'firstLambda' };
2932
SFOP._getLocation();
3033
await SFOP.hooks[global['hooks'].findState]();

tsconfig.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44

55
/* Basic Options */
66
// "incremental": true, /* Enable incremental compilation */
7-
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
8-
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
9-
"moduleResolution": "node", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
7+
"target": "es6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
8+
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
9+
"moduleResolution": "node" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
1010
// "lib": [], /* Specify library files to be included in the compilation. */
1111
// "allowJs": true, /* Allow javascript files to be compiled. */
1212
// "checkJs": true, /* Report errors in .js files. */
1313
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
14-
"declaration": true, /* Generates corresponding '.d.ts' file. */
14+
"declaration": true /* Generates corresponding '.d.ts' file. */,
1515
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
1616
// "sourceMap": true, /* Generates corresponding '.map' file. */
1717
// "outFile": "./", /* Concatenate and emit output to single file. */
18-
"outDir": "./dist", /* Redirect output structure to the directory. */
18+
"outDir": "./dist" /* Redirect output structure to the directory. */,
1919
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
2020
// "composite": true, /* Enable project compilation */
2121
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
@@ -26,8 +26,8 @@
2626
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
2727

2828
/* Strict Type-Checking Options */
29-
"strict": true, /* Enable all strict type-checking options. */
30-
"noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */
29+
"strict": true /* Enable all strict type-checking options. */,
30+
"noImplicitAny": false /* Raise error on expressions and declarations with an implied 'any' type. */,
3131
// "strictNullChecks": true, /* Enable strict null checks. */
3232
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
3333
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
@@ -46,18 +46,18 @@
4646
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
4747
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
4848
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
49-
// "rootDirs": [],
49+
// "rootDirs": [],
5050
"types": [
5151
"serverless",
5252
"lodash",
5353
"moment",
5454
"jest",
5555
"node"
56-
], /* List of root folders whose combined content represents the structure of the project at runtime. */
57-
"typeRoots": ["./node_modules/@types"], /* List of folders to include type definitions from. */
56+
] /* List of root folders whose combined content represents the structure of the project at runtime. */,
57+
"typeRoots": ["./node_modules/@types"] /* List of folders to include type definitions from. */,
5858
// "types": [], /* Type declaration files to be included in compilation. */
5959
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
60-
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
60+
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
6161
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
6262
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
6363

@@ -72,9 +72,9 @@
7272
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
7373

7474
/* Advanced Options */
75-
"skipLibCheck": true, /* Skip type checking of declaration files. */
76-
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
75+
"skipLibCheck": true /* Skip type checking of declaration files. */,
76+
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
7777
},
7878
"include": ["src"],
79-
"exclude": ["node_modules", "**/__tests__/*"]
79+
"exclude": ["node_modules"]
8080
}

0 commit comments

Comments
 (0)