Skip to content

Commit b732ab8

Browse files
committed
test: make more strict
1 parent 221afa7 commit b732ab8

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

packages/cloudwatch-metrics/__tests__/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ test.serial(
6464
const handler = middy(() => {})
6565

6666
const middleware = () => {
67-
t.true(metricsLoggerMock.setNamespace.calledWith('myNamespace'))
67+
t.true(metricsLoggerMock.setNamespace.calledWithExactly('myNamespace'))
6868
}
6969

7070
handler.use(metrics({ namespace: 'myNamespace' })).before(middleware)
@@ -81,7 +81,7 @@ test.serial(
8181

8282
const middleware = () => {
8383
t.true(
84-
metricsLoggerMock.setDimensions.calledWith({
84+
metricsLoggerMock.setDimensions.calledWithExactly({
8585
Runtime: 'NodeJS',
8686
Platform: 'ECS',
8787
Agent: 'CloudWatchAgent',
@@ -115,7 +115,7 @@ test.serial(
115115

116116
const middleware = () => {
117117
t.true(
118-
metricsLoggerMock.setDimensions.calledWith([
118+
metricsLoggerMock.setDimensions.calledWithExactly([
119119
{
120120
Runtime: 'NodeJS',
121121
Platform: 'ECS',

packages/http-error-handler/__tests__/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ test('It should be possible to pass a custom logger function', async (t) => {
9696

9797
await handler(event, context)
9898

99-
t.true(logger.calledWith(expectedError))
99+
t.true(logger.calledWithExactly(expectedError))
100100
})
101101

102102
test('It should be possible to pass in headers with error', async (t) => {

packages/http-json-body-parser/__tests__/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ test('It should use a reviver when parsing a JSON request', async (t) => {
6666

6767
await handler(event, defaultContext)
6868

69-
t.true(jsonParseSpy.calledWith(jsonString, reviver))
69+
t.true(jsonParseSpy.calledWithExactly(jsonString, reviver))
7070
})
7171

7272
test('It should parse a JSON request with lowercase header', async (t) => {

packages/ws-json-body-parser/__tests__/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ test('It should use a reviver when parsing a JSON request', async (t) => {
4040

4141
await handler(event, defaultContext)
4242

43-
t.true(jsonParseSpy.calledWith(jsonString, reviver))
43+
t.true(jsonParseSpy.calledWithExactly(jsonString, reviver))
4444
})
4545

4646
test('It should handle invalid JSON as an UnprocessableEntity', async (t) => {

0 commit comments

Comments
 (0)