-
-
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.
update dependencies and switch from eslint to prettier
- Loading branch information
1 parent
f3fede3
commit cad01b7
Showing
7 changed files
with
74 additions
and
80 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
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
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,9 @@ | ||
module.exports = { | ||
trailingComma: 'es5', | ||
tabWidth: 2, | ||
semi: false, | ||
singleQuote: true, | ||
useTabs: false, | ||
quoteProps: 'consistent', | ||
printWidth: 120, | ||
} |
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,42 +1,40 @@ | ||
/* global describe, it */ | ||
|
||
const { assert } = require('chai'); | ||
const { assert } = require('chai') | ||
|
||
const jeffsum = require('../index.js'); | ||
const jeffsum = require('../index.js') | ||
|
||
describe('jeffsum...', () => { | ||
describe('works, when...', () => { | ||
it('it returns 5 characters on jeffsum(5, "characters").', () => { | ||
const text = jeffsum(5, 'characters'); | ||
assert.lengthOf(text, 5); | ||
}); | ||
const text = jeffsum(5, 'characters') | ||
assert.lengthOf(text, 5) | ||
}) | ||
|
||
it('it returns 5 space separated words on jeffsum(5, "words").', () => { | ||
const text = jeffsum(5, 'words'); | ||
const numOfSpaces = (text.match(/ /g)).length; | ||
assert.equal(numOfSpaces, 4); | ||
}); | ||
const text = jeffsum(5, 'words') | ||
const numOfSpaces = text.match(/ /g).length | ||
assert.equal(numOfSpaces, 4) | ||
}) | ||
|
||
it('it returns 5 sentences on jeffsum(5, "sentences").', () => { | ||
const text = jeffsum(5, 'sentences'); | ||
const numOfDots = (text.match(/[^.!?]+[.!?]/g)).length; | ||
assert.equal(numOfDots, 5); | ||
}); | ||
}); | ||
const text = jeffsum(5, 'sentences') | ||
const numOfDots = text.match(/[^.!?]+[.!?]/g).length | ||
assert.equal(numOfDots, 5) | ||
}) | ||
}) | ||
|
||
describe('fails, when...', () => { | ||
it('first parameter is not a number.', () => { | ||
assert.throws( | ||
() => { jeffsum('five', 'sentences'); }, | ||
Error, | ||
); | ||
}); | ||
assert.throws(() => { | ||
jeffsum('five', 'sentences') | ||
}, Error) | ||
}) | ||
|
||
it('first parameter smaller than 0', () => { | ||
assert.throws( | ||
() => { jeffsum(-1, 'sentences'); }, | ||
Error, | ||
); | ||
}); | ||
}); | ||
}); | ||
assert.throws(() => { | ||
jeffsum(-1, 'sentences') | ||
}, Error) | ||
}) | ||
}) | ||
}) |