Skip to content
This repository was archived by the owner on Jul 8, 2023. It is now read-only.

Commit 77d318b

Browse files
committed
Improved tests.
1 parent 6839499 commit 77d318b

File tree

9 files changed

+314
-6
lines changed

9 files changed

+314
-6
lines changed

lib/CouchBuilder.js

Lines changed: 134 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/couchdb-builder.js

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/handler/CommonCoffeeHandler.js

Lines changed: 50 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/handler/CommonJsHandler.js

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/handler/JsonHandler.js

Lines changed: 39 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/handler/TextHandler.js

Lines changed: 39 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/CouchBuilder.coffee

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,11 @@ module.exports = class CouchBuilder
4040

4141
_processEntries: (entries) -> new Promise (resolve, reject) =>
4242
entries.sort (left, right) ->
43-
if left.path < right.path
44-
return -1
45-
else if left.path > right.path
46-
return 1
43+
return -1 if left.path < right.path
44+
return 1 if left.path > right.path
4745

48-
return 0
46+
### !pragma coverage-skip-next ###
47+
return 0 # should never get two identical paths
4948

5049
Promise.all(@_processPath entry.fullPath for entry in entries)
5150
.then (results) =>

test/fixture/tree/file-c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
c

test/suite/handler/CommonCoffeeHandler.spec.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe 'CommonCoffeeHandler', ->
4848
assert.instanceOf actual, SyntaxError
4949

5050
it 'handles file system errors', ->
51-
path = "#{__dirname}/../../fixture/invalid/nonexistent.js"
51+
path = "#{__dirname}/../../fixture/invalid/nonexistent.coffee"
5252

5353
return @subject.handle path
5454
.catch (actual) ->

0 commit comments

Comments
 (0)