Skip to content

Commit

Permalink
Add tests to removeExt
Browse files Browse the repository at this point in the history
  • Loading branch information
yucho committed Jul 23, 2019
1 parent 0fa07d4 commit ec7baed
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions source/spec/upath-spec.coffee
Expand Up @@ -388,6 +388,20 @@ describe "\n# upath v#{VERSION}", ->
runSpec inputToExpected, (input, expected)-> ->
equal upath.removeExt(input, '.js'), expected
equal upath.removeExt(input, 'js'), expected

describe """\n
It does not care about the length of exts.
`upath.removeExt(filename, '.longExt')` --returns-->\n
""", ->
inputToExpected =
'removedExt.longExt': 'removedExt'
'removedExt.txt.longExt': 'removedExt.txt'
'notRemoved.txt': 'notRemoved.txt'

runSpec inputToExpected, (input, expected)-> ->
equal upath.removeExt(input, '.longExt'), expected
equal upath.removeExt(input, 'longExt'), expected

describe """\n
#### `upath.changeExt(filename, [ext], [ignoreExts], [maxSize=7])`
Expand Down

0 comments on commit ec7baed

Please sign in to comment.