MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / getSample

Function getSample

functions/slack/test/unit.test.js:54–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52};
53
54const getSample = () => {
55 const config = {
56 SLACK_SECRET: SLACK_SECRET,
57 KG_API_KEY: KG_API_KEY,
58 };
59 const kgsearch = {
60 entities: {
61 search: sinon.stub().resolves(),
62 },
63 };
64 const googleapis = {
65 kgsearch: sinon.stub().returns(kgsearch),
66 };
67
68 return {
69 program: proxyquire('../', {
70 '@googleapis/kgsearch': googleapis,
71 process: {env: config},
72 }),
73 mocks: {
74 googleapis: googleapis,
75 kgsearch: kgsearch,
76 config: config,
77 },
78 };
79};
80
81const getMocks = () => {
82 const req = {

Callers 1

unit.test.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected