Skip to content

Commit 7e4a05d

Browse files
authored
Debugging instructions and launch config (#4)
* ignore .env coverage and .nyc_output * add debugging instructions * vscode launch configs for debugging
1 parent 5569812 commit 7e4a05d

File tree

3 files changed

+50
-1
lines changed

3 files changed

+50
-1
lines changed

.gitignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@
22
node_modules
33

44
# Serverless directories
5-
.serverless
5+
.serverless
6+
7+
.env
8+
coverage
9+
.nyc_output

.vscode/launch.json

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "Mocha",
11+
"runtimeExecutable": "nyc",
12+
"runtimeArgs": [
13+
"--reporter=lcov",
14+
"--reporter=cobertura",
15+
"--reporter=text-summary",
16+
"mocha",
17+
"--timeout",
18+
"999999",
19+
"--colors",
20+
"${workspaceFolder}"
21+
],
22+
"console": "integratedTerminal",
23+
"cwd": "${workspaceRoot}/",
24+
},
25+
{
26+
"type": "node",
27+
"request": "launch",
28+
"name": "Launch Probot",
29+
"runtimeExecutable": "probot",
30+
"runtimeArgs": ["run", "./app.js"],
31+
"console": "integratedTerminal",
32+
"cwd": "${workspaceRoot}/",
33+
}
34+
]
35+
}

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ For continuous deployment via GitHub action, copy [this repository's deploy work
3939
1. `SERVERLESS_ACCESS_KEY` - You can create a Serverless access key at `https://app.serverless.com/<your org>/settings/accessKeys`
4040
2. `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` - you will likely find your AWS credentials in `~/.aws/credentials`
4141

42+
### Debug via unit tests
43+
1. Intall nyc and mocha: `npm install -g nyc mocha`
44+
1. From the VSCode `RUN AND DEBUG` menu select `Mocha` and click the green arrow to start debugging.
45+
46+
### Debug by launching probot locally and sending it a payload
47+
48+
1. Point your GitHub app to your local using something like smee.io
49+
1. Copy .env-sample to .env and populate with values specific for your GitHub app. For the `PRIVATE_KEY` replace newlines with `\\n` to make the string value a single line.
50+
1. From the VSCode `RUN AND DEBUG` menu select `Launch Probot` and click the green arrow to start debugging.
51+
4252
## License
4353

4454
[ISC](LICENSE)

0 commit comments

Comments
 (0)