-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Append a newline terminator on the last line of the generated file
Terminate the generated file with a newline, even the last line, to make those files compliant with 3.3 of the current draft of the specification. #36
- Loading branch information
Showing
2 changed files
with
13 additions
and
13 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 |
---|---|---|
|
@@ -14,7 +14,7 @@ test('formats successfully with correct fields (singular contact field)', () => | |
'Contact: [email protected]\n' + | ||
'Encryption: https://www.mykey.com/pgp-key.txt\n' + | ||
'Acknowledgement: thank you\n' + | ||
'Permission: none' | ||
'Permission: none\n' | ||
) | ||
}) | ||
|
||
|
@@ -26,7 +26,7 @@ test('formats successfully with mandatory field only', () => { | |
const res = securityTxt.formatSecurityPolicy(options) | ||
|
||
expect(res).toBe( | ||
'Contact: [email protected]' | ||
'Contact: [email protected]\n' | ||
) | ||
}) | ||
|
||
|
@@ -54,7 +54,7 @@ test('formats successfully with multiple contact options and values in-tact', () | |
`Contact: ${website}\n` + | ||
`Contact: ${phone}\n` + | ||
`Encryption: ${encryption}\n` + | ||
`Acknowledgement: ${acknowledgement}` | ||
`Acknowledgement: ${acknowledgement}\n` | ||
) | ||
}) | ||
|
||
|
@@ -72,7 +72,7 @@ test('formats successfully with policy, hiring and signature fields', () => { | |
'Contact: [email protected]\n' + | ||
'Signature: http://example.com/.well-known/signature.txt.sig\n' + | ||
'Policy: http://example.com/policy.txt\n' + | ||
'Hiring: http://example.com/hiring.txt' | ||
'Hiring: http://example.com/hiring.txt\n' | ||
) | ||
}) | ||
|
||
|
@@ -86,6 +86,6 @@ test('formats successfully with "none" not in lowercase for Permission: directiv | |
|
||
expect(res).toBe( | ||
'Contact: [email protected]\n' + | ||
'Permission: NoNe' | ||
'Permission: NoNe\n' | ||
) | ||
}) |
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