Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/webhook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"build:clean": "shx rm -rf ./dist",
"docs": "npx typedoc --plugin typedoc-plugin-markdown",
"prepack": "npm run build",
"test": "npm run build && node --test-reporter=spec --test-reporter-destination=stdout --test-reporter=junit --test-reporter-destination=test-results.xml --import tsx --test src/IncomingWebhook.test.ts",
"test:coverage": "npm run build && node --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=lcov.info --test-reporter=junit --test-reporter-destination=test-results.xml --import tsx --test src/IncomingWebhook.test.ts"
"test": "npm run build && node --test-reporter=spec --test-reporter-destination=stdout --test-reporter=junit --test-reporter-destination=test-results.xml --import tsx --test src/*.test.ts",
"test:coverage": "npm run build && node --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=lcov.info --test-reporter=junit --test-reporter-destination=test-results.xml --import tsx --test src/*.test.ts"
},
"dependencies": {
"@slack/types": "^2.20.1",
Expand Down
2 changes: 2 additions & 0 deletions packages/webhook/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ export {
IncomingWebhookResult,
IncomingWebhookSendArguments,
} from './IncomingWebhook';

export {addAppMetadata} from './instrument';
16 changes: 16 additions & 0 deletions packages/webhook/src/instrument.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import assert from 'node:assert/strict';
import { describe, it } from 'node:test';

import { addAppMetadata } from './index';
import { getUserAgent } from './instrument';

describe('@slack/webhook public exports', () => {
it('exposes a working addAppMetadata from the package entry point', () => {
// addAppMetadata must be reachable from the package's public API (./index) and the instrument function.
addAppMetadata({ name: '@slack/slack-github-action', version: '3.0.3' });
assert.ok(
getUserAgent().includes('@slack:slack-github-action/3.0.3'),
'addAppMetadata re-exported from ./index should affect the User-Agent',
);
});
});