Skip to content

Commit

Permalink
test: use strict assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
msimerson committed Feb 23, 2024
1 parent 318774e commit 1ca2f99
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions test/address.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

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

const Address = require('../index').Address;

Expand Down Expand Up @@ -119,29 +119,25 @@ describe('isNull', function () {
})

describe('format()', function () {
it('works', function (done) {
it('works', function () {
const addr = new Address('<matt@example.com>');
assert.equal(addr.user, 'matt');
assert.equal(addr.host, 'example.com');
assert.equal(addr.format(), '<matt@example.com>');
done();
})

it('lower cases hostnames', function (done) {
it('lower cases hostnames', function () {
const addr = new Address('<matt@exAMple.com>');
assert.equal(addr.host, 'example.com');
done();
})

it('no latin escaping', function (done) {
it('no latin escaping', function () {
const addr = new Address('<přílišžluťoučkýkůň@přílišžluťoučkýkůň.cz>');
assert.equal(addr.format(), '<přílišžluťoučkýkůň@přílišžluťoučkýkůň.cz>');
done();
})

it('spaces inside a quoted string', function (done) {
it('spaces inside a quoted string', function () {
const addr = new Address('<"pří lišžlu ťoučkýkůň"@přílišžluťoučkýkůň.cz>');
assert.equal(addr.format(), '<"pří lišžlu ťoučkýkůň"@přílišžluťoučkýkůň.cz>');
done();
})
})

0 comments on commit 1ca2f99

Please sign in to comment.