From 9c8962d6dc9383222e397ec611e21fbadffa8127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Wendt?= Date: Sat, 19 Oct 2024 17:41:02 +0200 Subject: [PATCH] chore: tests use strict asserts only --- test/batch-requests.js | 2 +- test/has-new-notifications.js | 10 +++++----- test/me.js | 2 +- test/notifications.js | 2 +- test/options.js | 2 +- test/reducer.js | 2 +- test/unsubscribe.js | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/test/batch-requests.js b/test/batch-requests.js index 2b03ff1..f00e100 100644 --- a/test/batch-requests.js +++ b/test/batch-requests.js @@ -1,4 +1,4 @@ -import assert from 'node:assert'; +import assert from 'node:assert/strict'; import { describe, it, beforeEach, afterEach, mock } from 'node:test'; import { FetchInterceptor } from '@mswjs/interceptors/fetch' import { GitHubClient } from '../lib/client.js'; diff --git a/test/has-new-notifications.js b/test/has-new-notifications.js index 2d98b41..1f1042a 100644 --- a/test/has-new-notifications.js +++ b/test/has-new-notifications.js @@ -1,4 +1,4 @@ -import assert from 'node:assert'; +import assert from 'node:assert/strict'; import { describe, it, beforeEach, afterEach } from 'node:test'; import { FetchInterceptor } from '@mswjs/interceptors/fetch' import { GitHubClient } from '../lib/client.js'; @@ -50,7 +50,7 @@ describe('checking for new notifications', async () => { describe('when HEAD request responds with 304', async () => { beforeEach(() => { - headResponse = new Response(null, { status: 304, headers: { 'x-poll-interval': 123 } }); + headResponse = new Response(null, { status: 304, headers: { 'x-poll-interval': '123' } }); }); it('has no new notifications', async () => { @@ -65,13 +65,13 @@ describe('checking for new notifications', async () => { await github.notifications(); await github.hasNewNotifications(); - assert.equal(github.pollInterval, 123); + assert.equal(github.pollInterval, '123'); }); }); describe('when HEAD request responds with 200', async () => { beforeEach(() => { - headResponse = Response.json( [], { status: 200, headers: { 'X-Poll-Interval': 123 } }); + headResponse = Response.json( [], { status: 200, headers: { 'X-Poll-Interval': '123' } }); }); it('has new notifications', async () => { @@ -86,7 +86,7 @@ describe('checking for new notifications', async () => { await github.notifications(); await github.hasNewNotifications(); - assert.equal(github.pollInterval, 123); + assert.equal(github.pollInterval, '123'); }); }); diff --git a/test/me.js b/test/me.js index 96d67b3..2e6bb98 100644 --- a/test/me.js +++ b/test/me.js @@ -1,4 +1,4 @@ -import assert from 'node:assert'; +import assert from 'node:assert/strict'; import { describe, it, beforeEach, afterEach } from 'node:test'; import { FetchInterceptor } from '@mswjs/interceptors/fetch' import { GitHubClient } from '../lib/client.js'; diff --git a/test/notifications.js b/test/notifications.js index 3bb3896..6e8e7ec 100644 --- a/test/notifications.js +++ b/test/notifications.js @@ -1,4 +1,4 @@ -import assert from 'node:assert'; +import assert from 'node:assert/strict'; import { describe, it, beforeEach, afterEach } from 'node:test'; import { FetchInterceptor } from '@mswjs/interceptors/fetch' import { GitHubClient } from '../lib/client.js'; diff --git a/test/options.js b/test/options.js index 62ccfe2..6d08d72 100644 --- a/test/options.js +++ b/test/options.js @@ -1,4 +1,4 @@ -import assert from 'node:assert'; +import assert from 'node:assert/strict'; import { describe, it, beforeEach, afterEach } from 'node:test'; import { FetchInterceptor } from '@mswjs/interceptors/fetch' import { GitHubClient } from '../lib/client.js'; diff --git a/test/reducer.js b/test/reducer.js index 815958a..ede0864 100644 --- a/test/reducer.js +++ b/test/reducer.js @@ -1,4 +1,4 @@ -import assert from 'node:assert'; +import assert from 'node:assert/strict'; import { describe, it } from 'node:test'; import { NotificationReducer } from '../lib/notification-reducer.js'; diff --git a/test/unsubscribe.js b/test/unsubscribe.js index 970e88b..ed564b6 100644 --- a/test/unsubscribe.js +++ b/test/unsubscribe.js @@ -1,4 +1,4 @@ -import assert from 'node:assert'; +import assert from 'node:assert/strict'; import { describe, it, beforeEach, afterEach } from 'node:test'; import { FetchInterceptor } from '@mswjs/interceptors/fetch' import { GitHubClient } from '../lib/client.js';