Skip to content

Commit

Permalink
Merge pull request #7 from awendt/strict-asserts
Browse files Browse the repository at this point in the history
chore: tests use strict asserts only
  • Loading branch information
awendt authored Nov 9, 2024
2 parents 0ab09a3 + 9c8962d commit 0d63ad1
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
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

0 comments on commit 0d63ad1

Please sign in to comment.