-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
5 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
||
|
@@ -119,29 +119,25 @@ describe('isNull', function () { | |
}) | ||
|
||
describe('format()', function () { | ||
it('works', function (done) { | ||
it('works', function () { | ||
const addr = new Address('<[email protected]>'); | ||
assert.equal(addr.user, 'matt'); | ||
assert.equal(addr.host, 'example.com'); | ||
assert.equal(addr.format(), '<[email protected]>'); | ||
done(); | ||
}) | ||
|
||
it('lower cases hostnames', function (done) { | ||
it('lower cases hostnames', function () { | ||
const addr = new Address('<[email protected]>'); | ||
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(); | ||
}) | ||
}) |