-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
24f433e
commit 12f9fbb
Showing
4 changed files
with
41 additions
and
31 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
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* eslint-disable prefer-arrow-callback */ | ||
'use strict'; | ||
|
||
const trim = require('../'); | ||
|
||
describe('trimWhitespace', function () { | ||
it('should remove leading and trailing spaces and tabs', function () { | ||
expect(trim(' Anakin Skywalker \n Padme Amidala ')).toEqual('Anakin Skywalker\nPadme Amidala'); | ||
expect(trim('\t\tAnakin Skywalker\t\t\n\t\tPadme Amidala\t\t')).toEqual('Anakin Skywalker\nPadme Amidala'); | ||
expect(trim(' \tAnakin Skywalker \t\n\t Padme Amidala\t ')).toEqual('Anakin Skywalker\nPadme Amidala'); | ||
expect(trim('\n \tAnakin Skywalker \t\n\t Padme Amidala\t \n')).toEqual('\nAnakin Skywalker\nPadme Amidala\n'); | ||
}); | ||
|
||
it('should remove leading spaces and tabs', function () { | ||
expect(trim.leading(' Anakin Skywalker \n Padme Amidala ')).toEqual('Anakin Skywalker \nPadme Amidala '); | ||
expect(trim.leading('\t\tAnakin Skywalker\t\t\n\t\tPadme Amidala\t\t')).toEqual('Anakin Skywalker\t\t\nPadme Amidala\t\t'); | ||
expect(trim.leading(' \tAnakin Skywalker \t\n\t Padme Amidala\t ')).toEqual('Anakin Skywalker \t\nPadme Amidala\t '); | ||
expect(trim.leading('\n \tAnakin Skywalker \t\n\t Padme Amidala\t \n')).toEqual('\nAnakin Skywalker \t\nPadme Amidala\t \n'); | ||
}); | ||
|
||
it('should remove trailing spaces and tabs', function () { | ||
expect(trim.trailing(' Anakin Skywalker \n Padme Amidala ')).toEqual(' Anakin Skywalker\n Padme Amidala'); | ||
expect(trim.trailing('\t\tAnakin Skywalker\t\t\n\t\tPadme Amidala\t\t')).toEqual('\t\tAnakin Skywalker\n\t\tPadme Amidala'); | ||
expect(trim.trailing(' \tAnakin Skywalker \t\n\t Padme Amidala\t ')).toEqual(' \tAnakin Skywalker\n\t Padme Amidala'); | ||
expect(trim.trailing('\n \tAnakin Skywalker \t\n\t Padme Amidala\t \n')).toEqual('\n \tAnakin Skywalker\n\t Padme Amidala\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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"spec_dir": "spec", | ||
"spec_files": [ | ||
"**/*[sS]pec.js" | ||
], | ||
"helpers": [ | ||
"helpers/**/*.js" | ||
], | ||
"stopSpecOnExpectationFailure": false, | ||
"random": false | ||
} |
This file was deleted.
Oops, something went wrong.