forked from aws/aws-sam-cli
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: test building npm and Typescript projects using external manife…
…st file. (aws#5283) * test: test building npm and Typescript projects using external manifest file. * fix mypy issues * remove node 12.x, and add the new node versions * run make format
- Loading branch information
Showing
8 changed files
with
196 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
tests/integration/testdata/buildcmd/Esbuild/Node_without_manifest/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
exports.lambdaHandler = async (event, context) => { | ||
return { | ||
statusCode: 200, | ||
body: JSON.stringify({ | ||
message: 'hello world!', | ||
}), | ||
}; | ||
}; |
24 changes: 24 additions & 0 deletions
24
tests/integration/testdata/buildcmd/Esbuild/TypeScript_without_manifest/app.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { APIGatewayProxyEvent, APIGatewayProxyResult } from 'aws-lambda'; | ||
|
||
export const lambdaHandler = async (event: APIGatewayProxyEvent): Promise<APIGatewayProxyResult> => { | ||
let response: APIGatewayProxyResult; | ||
|
||
try { | ||
response = { | ||
statusCode: 200, | ||
body: JSON.stringify({ | ||
message: 'hello world!', | ||
}), | ||
}; | ||
} catch (err) { | ||
console.log(err); | ||
response = { | ||
statusCode: 500, | ||
body: JSON.stringify({ | ||
message: 'some error happened', | ||
}), | ||
}; | ||
} | ||
|
||
return response; | ||
}; |
24 changes: 24 additions & 0 deletions
24
.../integration/testdata/buildcmd/Esbuild/TypeScript_without_manifest/nested/function/app.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { APIGatewayProxyEvent, APIGatewayProxyResult } from 'aws-lambda'; | ||
|
||
export const lambdaHandler = async (event: APIGatewayProxyEvent): Promise<APIGatewayProxyResult> => { | ||
let response: APIGatewayProxyResult; | ||
|
||
try { | ||
response = { | ||
statusCode: 200, | ||
body: JSON.stringify({ | ||
message: 'hello world!', | ||
}), | ||
}; | ||
} catch (err) { | ||
console.log(err); | ||
response = { | ||
statusCode: 500, | ||
body: JSON.stringify({ | ||
message: 'some error happened', | ||
}), | ||
}; | ||
} | ||
|
||
return response; | ||
}; |
14 changes: 14 additions & 0 deletions
14
tests/integration/testdata/buildcmd/Esbuild/npm_manifest/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "npmdeps", | ||
"version": "1.0.0", | ||
"description": "", | ||
"keywords": [], | ||
"author": "", | ||
"license": "APACHE2.0", | ||
"main": "main.js", | ||
"dependencies": { | ||
"@types/aws-lambda": "^8.10.92", | ||
"minimal-request-promise": "*", | ||
"esbuild": "^0.14.14" | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
tests/integration/testdata/buildcmd/Node_without_manifest/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
exports.lambdaHandler = async (event, context) => { | ||
return { | ||
statusCode: 200, | ||
body: JSON.stringify({ | ||
message: 'hello world!', | ||
}), | ||
} | ||
}; | ||
|
||
exports.secondLambdaHandler = async (event, context) => { | ||
return 'Hello Mars' | ||
}; |
11 changes: 11 additions & 0 deletions
11
tests/integration/testdata/buildcmd/npm_manifest/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "npmdeps", | ||
"version": "1.0.0", | ||
"description": "", | ||
"keywords": [], | ||
"author": "", | ||
"license": "APACHE2.0", | ||
"dependencies": { | ||
"minimal-request-promise": "*" | ||
} | ||
} |