Skip to content

Commit 143a42e

Browse files
committed
Test added
1 parent 14b2415 commit 143a42e

File tree

7 files changed

+317
-1
lines changed

7 files changed

+317
-1
lines changed

src/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ function plugins() {
300300

301301
if (ENABLE_LINTING) {
302302
if (parsedTsConfig.exclude) {
303-
tsEslintConfig.ignorePatterns = parsedTsConfig.exclude
303+
tsEslintConfig.ignorePatterns = parsedTsConfig.exclude;
304304
}
305305
forkTsCheckerWebpackOptions.eslint = {
306306
files: path.join(servicePath, "**/*.ts"),

tests/minify-options/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# package directories
2+
node_modules
3+
jspm_packages
4+
5+
# Serverless directories
6+
.serverless

tests/minify-options/handler.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
function namedFunction() {
2+
return null;
3+
}
4+
5+
class NamedClass {}
6+
7+
export const hello = async () => {
8+
return {
9+
statusCode: 200,
10+
body: JSON.stringify({
11+
functionName: namedFunction.name,
12+
className: NamedClass.name,
13+
}),
14+
};
15+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const { runSlsCommand, clearNpmCache, errorRegex } = require("../helpers");
2+
3+
beforeEach(async () => {
4+
await clearNpmCache(__dirname);
5+
});
6+
7+
afterAll(async () => {
8+
await clearNpmCache(__dirname);
9+
});
10+
11+
test("minify-options", async () => {
12+
const result = await runSlsCommand(__dirname);
13+
14+
expect(result).not.toMatch(errorRegex);
15+
});

tests/minify-options/package-lock.json

Lines changed: 246 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/minify-options/package.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "esbuild",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "handler.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"keywords": [],
10+
"author": "",
11+
"license": "ISC",
12+
"devDependencies": {
13+
"esbuild-loader": "^2.9.2",
14+
"reflect-metadata": "^0.1.13"
15+
},
16+
"dependencies": {}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
service: my-service
2+
3+
plugins:
4+
- '../../index'
5+
6+
custom:
7+
bundle:
8+
minifyOptions:
9+
keepNames: true
10+
11+
provider:
12+
name: aws
13+
runtime: nodejs14.x
14+
15+
functions:
16+
hello:
17+
handler: handler.hello

0 commit comments

Comments
 (0)