Skip to content

Commit

Permalink
Use strict assertion mode
Browse files Browse the repository at this point in the history
  • Loading branch information
eliangcs committed Oct 31, 2024
1 parent 72b43ad commit cb6bdd9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/core/test/tools/fetch-logger.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* global Request */

const assert = require('node:assert');
const assert = require('node:assert/strict');

const { HTTPBIN_URL } = require('../constants');
const wrapFetchWithLogger = require('../../src/tools/fetch-logger');
Expand All @@ -23,7 +23,7 @@ describe('wrap fetch with logger', () => {

// Make sure fetch works as original
assert.equal(response.status, 200);
assert.equal(data.args.foo, 'bar');
assert.deepEqual(data.args.foo, ['bar']);

assert.equal(logs.length, 1);

Expand All @@ -37,7 +37,7 @@ describe('wrap fetch with logger', () => {
assert.ok(loggedHeaders['content-type'].startsWith('application/json'));

const loggedContent = JSON.parse(log.data.response_content);
assert.equal(loggedContent.args.foo, 'bar');
assert.deepEqual(loggedContent.args.foo, ['bar']);
});

it('should log POST with url string input', async () => {
Expand Down Expand Up @@ -72,7 +72,7 @@ describe('wrap fetch with logger', () => {

// Make sure fetch works as original
assert.equal(response.status, 200);
assert.equal(data.args.foo, 'bar');
assert.deepEqual(data.args.foo, ['bar']);

assert.equal(logs.length, 1);

Expand All @@ -86,7 +86,7 @@ describe('wrap fetch with logger', () => {
assert.ok(loggedHeaders['content-type'].startsWith('application/json'));

const loggedContent = JSON.parse(log.data.response_content);
assert.equal(loggedContent.args.foo, 'bar');
assert.deepEqual(loggedContent.args.foo, ['bar']);
});

it('should log POST for Request object input', async () => {
Expand Down Expand Up @@ -199,7 +199,7 @@ describe('wrap fetch with logger', () => {
const data = await response.json();

assert.equal(response.status, 200);
assert.equal(data.args.made_by, 'z.request');
assert.deepEqual(data.args.made_by, ['z.request']);

// No logs should be created
assert.equal(logs.length, 0);
Expand Down

0 comments on commit cb6bdd9

Please sign in to comment.