Skip to content

Commit

Permalink
deps: skuba 7.0.1 (#212)
Browse files Browse the repository at this point in the history
* deps: skuba 7.0.1

* Node 18

* Fix noUncheckedIndexedAccess issues

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tomas Bolger <tbolger@seek.com.au>
  • Loading branch information
renovate[bot] and tbolg authored Jul 26, 2023
1 parent d52bbc0 commit e653343
Show file tree
Hide file tree
Showing 7 changed files with 1,577 additions and 1,652 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
with:
fetch-depth: 0

- name: Set up Node.js 16.x
- name: Set up Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 18.x

- name: Install dependencies
run: yarn install --frozen-lockfile
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
- name: Check out repo
uses: actions/checkout@v3

- name: Set up Node.js 16.x
- name: Set up Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 18.x

- name: Install dependencies
run: yarn install --frozen-lockfile
Expand Down
13 changes: 0 additions & 13 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
# managed by skuba
.idea/*
.vscode/*

.cdk.staging/
.serverless/
cdk.out/
node_modules*/

/coverage*/
/dist*/
/lib*/
/tmp*/

# Gantry resource files support non-standard template syntax
/.gantry/**/*.yaml
/.gantry/**/*.yml
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"datadog-lambda-js": "6.89.0",
"dd-trace": "3.28.0",
"hot-shots": "10.0.0",
"skuba": "6.2.0"
"skuba": "7.0.1"
},
"peerDependencies": {
"datadog-lambda-js": "6.x || 7.x",
Expand Down
32 changes: 21 additions & 11 deletions src/createCloudWatchClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ describe('createCloudWatchClient', () => {
it('should record integer timings without tags', () => {
metricsClient.timing('my_custom_metric', 100);

expect(stdoutSpy).toHaveBeenCalledTimes(1);
expect(stdoutSpy.mock.calls[0][0]).toMatchInlineSnapshot(`
const [buffer] = stdoutSpy.mock.calls[0] ?? [];
expect(buffer).toMatchInlineSnapshot(`
"MONITORING|31337|100|histogram|test.my_custom_metric|#env:jest
"
`);
Expand All @@ -31,7 +31,9 @@ describe('createCloudWatchClient', () => {
metricsClient.timing('my_custom_metric', 1234.5, ['pipe|special|char']);

expect(stdoutSpy).toHaveBeenCalledTimes(1);
expect(stdoutSpy.mock.calls[0][0]).toMatchInlineSnapshot(`

const [buffer] = stdoutSpy.mock.calls[0] ?? [];
expect(buffer).toMatchInlineSnapshot(`
"MONITORING|31337|1234.5|histogram|test.my_custom_metric|#env:jest,pipe_special_char
"
`);
Expand All @@ -43,7 +45,8 @@ describe('createCloudWatchClient', () => {
metricsClient.histogram('my_custom_metric', 100);

expect(stdoutSpy).toHaveBeenCalledTimes(1);
expect(stdoutSpy.mock.calls[0][0]).toMatchInlineSnapshot(`
const [buffer] = stdoutSpy.mock.calls[0] ?? [];
expect(buffer).toMatchInlineSnapshot(`
"MONITORING|31337|100|histogram|test.my_custom_metric|#env:jest
"
`);
Expand All @@ -55,7 +58,8 @@ describe('createCloudWatchClient', () => {
]);

expect(stdoutSpy).toHaveBeenCalledTimes(1);
expect(stdoutSpy.mock.calls[0][0]).toMatchInlineSnapshot(`
const [buffer] = stdoutSpy.mock.calls[0] ?? [];
expect(buffer).toMatchInlineSnapshot(`
"MONITORING|31337|1234.5|histogram|test.my_custom_metric|#env:jest,pipe_special_char
"
`);
Expand All @@ -67,7 +71,8 @@ describe('createCloudWatchClient', () => {
metricsClient.increment('my_custom_metric');

expect(stdoutSpy).toHaveBeenCalledTimes(1);
expect(stdoutSpy.mock.calls[0][0]).toMatchInlineSnapshot(`
const [buffer] = stdoutSpy.mock.calls[0] ?? [];
expect(buffer).toMatchInlineSnapshot(`
"MONITORING|31337|1|count|test.my_custom_metric|#env:jest
"
`);
Expand All @@ -77,7 +82,8 @@ describe('createCloudWatchClient', () => {
metricsClient.increment('my_custom_metric', ['comma,special,char']);

expect(stdoutSpy).toHaveBeenCalledTimes(1);
expect(stdoutSpy.mock.calls[0][0]).toMatchInlineSnapshot(`
const [buffer] = stdoutSpy.mock.calls[0] ?? [];
expect(buffer).toMatchInlineSnapshot(`
"MONITORING|31337|1|count|test.my_custom_metric|#env:jest,comma_special_char
"
`);
Expand All @@ -87,7 +93,8 @@ describe('createCloudWatchClient', () => {
metricsClient.increment('my_custom_metric', 10);

expect(stdoutSpy).toHaveBeenCalledTimes(1);
expect(stdoutSpy.mock.calls[0][0]).toMatchInlineSnapshot(`
const [buffer] = stdoutSpy.mock.calls[0] ?? [];
expect(buffer).toMatchInlineSnapshot(`
"MONITORING|31337|10|count|test.my_custom_metric|#env:jest
"
`);
Expand All @@ -97,7 +104,8 @@ describe('createCloudWatchClient', () => {
metricsClient.increment('my_custom_metric', 10, ['compound:tag']);

expect(stdoutSpy).toHaveBeenCalledTimes(1);
expect(stdoutSpy.mock.calls[0][0]).toMatchInlineSnapshot(`
const [buffer] = stdoutSpy.mock.calls[0] ?? [];
expect(buffer).toMatchInlineSnapshot(`
"MONITORING|31337|10|count|test.my_custom_metric|#env:jest,compound:tag
"
`);
Expand All @@ -109,7 +117,8 @@ describe('createCloudWatchClient', () => {
metricsClient.decrement('my_custom_metric');

expect(stdoutSpy).toHaveBeenCalledTimes(1);
expect(stdoutSpy.mock.calls[0][0]).toMatchInlineSnapshot(`
const [buffer] = stdoutSpy.mock.calls[0] ?? [];
expect(buffer).toMatchInlineSnapshot(`
"MONITORING|31337|-1|count|test.my_custom_metric|#env:jest
"
`);
Expand All @@ -119,7 +128,8 @@ describe('createCloudWatchClient', () => {
metricsClient.decrement('my_custom_metric', 10);

expect(stdoutSpy).toHaveBeenCalledTimes(1);
expect(stdoutSpy.mock.calls[0][0]).toMatchInlineSnapshot(`
const [buffer] = stdoutSpy.mock.calls[0] ?? [];
expect(buffer).toMatchInlineSnapshot(`
"MONITORING|31337|-10|count|test.my_custom_metric|#env:jest
"
`);
Expand Down
8 changes: 4 additions & 4 deletions src/createTimedSpan.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ describe('timedSpan', () => {

expect(mockIncrement).toHaveBeenCalledTimes(1);
{
const [name, tags] = mockIncrement.mock.calls[0];
const [name, tags] = mockIncrement.mock.calls[0] ?? [];

expect(name).toBe('test.count');
expect(tags).toEqual(['success']);
}

expect(mockTiming).toHaveBeenCalledTimes(1);
{
const [name, latency] = mockTiming.mock.calls[0];
const [name, latency] = mockTiming.mock.calls[0] ?? [];

expect(name).toBe('test.latency');
expect(latency).toBeGreaterThanOrEqual(0);
Expand Down Expand Up @@ -150,15 +150,15 @@ describe('timedSpan', () => {

expect(mockIncrement).toHaveBeenCalledTimes(1);
{
const [name, tags] = mockIncrement.mock.calls[0];
const [name, tags] = mockIncrement.mock.calls[0] ?? [];

expect(name).toBe('test.count');
expect(tags).toEqual(['failure']);
}

expect(mockTiming).toHaveBeenCalledTimes(1);
{
const [name, latency] = mockTiming.mock.calls[0];
const [name, latency] = mockTiming.mock.calls[0] ?? [];

expect(name).toBe('test.latency');
expect(latency).toBeGreaterThanOrEqual(0);
Expand Down
Loading

0 comments on commit e653343

Please sign in to comment.