Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
chore: fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed May 29, 2019
1 parent 8e36a74 commit 6b0ea3c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/sharding.js
Expand Up @@ -94,7 +94,7 @@ class ShardingDatastore {
return this.child.batch()
}

query (q) {
query (q) {
const tq = {
keysOnly: q.keysOnly,
offset: q.offset,
Expand Down
2 changes: 1 addition & 1 deletion src/tiered.js
Expand Up @@ -87,7 +87,7 @@ class TieredDatastore {
}
}

query (q) {
query (q) {
return this.stores[this.stores.length - 1].query(q)
}
}
Expand Down
56 changes: 28 additions & 28 deletions test/shard.spec.js
Expand Up @@ -62,39 +62,39 @@ describe('shard', () => {
'/repo/flatfs/shard/v1/next-to-last/2'
)
})
})

describe('parsesShardFun', () => {
it('errors', () => {
const errors = [
'',
'shard/v1/next-to-last/2',
'/repo/flatfs/shard/v2/next-to-last/2',
'/repo/flatfs/shard/v1/other/2',
'/repo/flatfs/shard/v1/next-to-last/'
]
describe('parsesShardFun', () => {
it('errors', () => {
const errors = [
'',
'shard/v1/next-to-last/2',
'/repo/flatfs/shard/v2/next-to-last/2',
'/repo/flatfs/shard/v1/other/2',
'/repo/flatfs/shard/v1/next-to-last/'
]

errors.forEach((input) => {
expect(
() => shard.parseShardFun(input)
).to.throw()
})
errors.forEach((input) => {
expect(
() => shard.parseShardFun(input)
).to.throw()
})
})

it('success', () => {
const success = [
'prefix',
'suffix',
'next-to-last'
]
it('success', () => {
const success = [
'prefix',
'suffix',
'next-to-last'
]

success.forEach((name) => {
const n = Math.floor(Math.random() * 100)
expect(
shard.parseShardFun(
`/repo/flatfs/shard/v1/${name}/${n}`
).name
).to.eql(name)
})
success.forEach((name) => {
const n = Math.floor(Math.random() * 100)
expect(
shard.parseShardFun(
`/repo/flatfs/shard/v1/${name}/${n}`
).name
).to.eql(name)
})
})
})

0 comments on commit 6b0ea3c

Please sign in to comment.