-
-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: test for typescript project references
- Loading branch information
Showing
12 changed files
with
101 additions
and
0 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
5 changes: 5 additions & 0 deletions
5
tests/typescript-project-references/lib-bar/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,6 @@ | ||
{ | ||
"name": "lib-bar", | ||
"version": "1.0.0", | ||
"main": "dist/index.js", | ||
"license": "MIT" | ||
} |
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 @@ | ||
export const getMeaningOfLife = () => "42, so they tell me"; |
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 @@ | ||
{ | ||
"extends": "../tsconfig-base.json", | ||
"compilerOptions": { | ||
"outDir": "dist", | ||
"rootDir": "src" | ||
}, | ||
"include": ["src/"] | ||
} |
11 changes: 11 additions & 0 deletions
11
tests/typescript-project-references/service-foo/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,9 @@ | ||
{ | ||
"name": "service-foo", | ||
"version": "1.0.0", | ||
"main": "dist/index.js", | ||
"license": "MIT", | ||
"dependencies": { | ||
"lib-bar": "file:../lib-bar" | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
tests/typescript-project-references/service-foo/serverless.yml
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,12 @@ | ||
service: service-foo | ||
|
||
plugins: | ||
- '../../../index' | ||
|
||
provider: | ||
name: aws | ||
runtime: nodejs10.x | ||
|
||
functions: | ||
hello: | ||
handler: src/handler.hello |
11 changes: 11 additions & 0 deletions
11
tests/typescript-project-references/service-foo/src/handler.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,11 @@ | ||
import { getMeaningOfLife } from "lib-bar"; | ||
|
||
export const hello = async (event: any) => { | ||
return { | ||
statusCode: 200, | ||
body: JSON.stringify({ | ||
message: getMeaningOfLife(), | ||
input: event | ||
}) | ||
}; | ||
}; |
9 changes: 9 additions & 0 deletions
9
tests/typescript-project-references/service-foo/tsconfig.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,9 @@ | ||
{ | ||
"extends": "../tsconfig-base.json", | ||
"compilerOptions": { | ||
"outDir": "dist", | ||
"rootDir": "src" | ||
}, | ||
"include": ["src/"], | ||
"references": [{ "path": "../lib-bar" }] | ||
} |
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,9 @@ | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"target": "es6", | ||
"moduleResolution": "node", | ||
"composite": true, | ||
"incremental": true | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
tests/typescript-project-references/typescript-project-references.test.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,16 @@ | ||
const { runSlsCommand, clearNpmCache } = require("../helpers"); | ||
const { join } = require("path"); | ||
|
||
beforeEach(async () => { | ||
await clearNpmCache(__dirname); | ||
}); | ||
|
||
afterAll(async () => { | ||
await clearNpmCache(__dirname); | ||
}); | ||
|
||
test("typescript-project-references", async () => { | ||
const result = await runSlsCommand(join(__dirname, "service-foo")); | ||
|
||
expect(result).toContain("42, so they tell me"); | ||
}); |