Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: tests use strict asserts only #7

Merged
merged 1 commit into from
Nov 9, 2024
Merged
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
2 changes: 1 addition & 1 deletion test/batch-requests.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
10 changes: 5 additions & 5 deletions test/has-new-notifications.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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 () => {
Expand All @@ -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 () => {
Expand All @@ -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');
});
});

Expand Down
2 changes: 1 addition & 1 deletion test/me.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion test/notifications.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion test/options.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion test/reducer.js
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
2 changes: 1 addition & 1 deletion test/unsubscribe.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down