Skip to content

Instantly share code, notes, and snippets.

@jcrossley3
Created May 25, 2021 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcrossley3/308160866a98f2e072569ecf465b4f28 to your computer and use it in GitHub Desktop.
Save jcrossley3/308160866a98f2e072569ecf465b4f28 to your computer and use it in GitHub Desktop.
[jim@localhost events]$ npm install
> nodemon@2.0.5 postinstall /home/jim/src/func/templates/node/events/node_modules/nodemon
> node bin/postinstall || exit 0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
added 280 packages from 184 contributors and audited 281 packages in 8.318s
38 packages are looking for funding
run `npm fund` for details
found 4 vulnerabilities (3 low, 1 high)
run `npm audit fix` to fix them, or `npm audit` for details
[jim@localhost events]$ npm test
> event-handler@0.1.0 test /home/jim/src/func/templates/node/events
> node test/unit.js && node test/integration.js
TAP version 13
# Unit: handles a valid event
context
{
"cloudevent": {
"id": "01234",
"type": "com.example.cloudevents.test",
"source": "/test",
"specversion": "1.0",
"time": "2021-05-25T15:51:03.003Z",
"data": {
"name": "tiger",
"customerId": "01234"
}
},
"log": {}
}
event
{
"name": "tiger",
"customerId": "01234"
}
ok 1 should be truthy
ok 2 should be equal
ok 3 should be equal
ok 4 should be equal
1..4
# tests 4
# pass 4
# ok
TAP version 13
# Integration: handles a valid event
/home/jim/src/func/templates/node/events/test/integration.js:22
runtime(func, server => {
^
TypeError: runtime is not a function
at Test.<anonymous> (/home/jim/src/func/templates/node/events/test/integration.js:22:3)
at Test.bound [as _cb] (/home/jim/src/func/templates/node/events/node_modules/tape/lib/test.js:80:32)
at Test.run (/home/jim/src/func/templates/node/events/node_modules/tape/lib/test.js:96:10)
at Test.bound [as run] (/home/jim/src/func/templates/node/events/node_modules/tape/lib/test.js:80:32)
at Immediate.next (/home/jim/src/func/templates/node/events/node_modules/tape/lib/results.js:83:19)
at processImmediate (internal/timers.js:462:21)
npm ERR! Test failed. See above for more details.
[jim@localhost events]$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment