Skip to content

Commit

Permalink
chore: Apply latest nlm generator
Browse files Browse the repository at this point in the history
  • Loading branch information
grpn-bulk-nlm committed Jan 5, 2018
1 parent 44c3bb8 commit 535aa21
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/package-lock.json
/yarn.lock
node_modules/
/tmp
Expand Down
23 changes: 12 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
language: node_js
node_js:
- '0.10'
- '4'
- 4.6.1
- 6.11.5
- 8.9.0
deploy:
- provider: script
script: ./node_modules/.bin/nlm release
skip_cleanup: true
'on':
branch: master
node: 8.9.0
before_install:
- npm install -g npm@latest-2
before_deploy:
- 'git config --global user.email "[email protected]"'
- 'git config --global user.name "Groupon"'
deploy:
provider: script
script: ./node_modules/.bin/nlm release
skip_cleanup: true
'on':
branch: master
node: '4'
- git config --global user.email "[email protected]"
- git config --global user.name "Groupon"
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- Generated by generator-nlm -->
<!-- Generated by generator-js -->

# Contributing

Expand Down Expand Up @@ -31,7 +31,7 @@ If you report a bug, please follow these guidelines:

For small documentation changes, you can use [Github's editing feature](https://help.github.com/articles/editing-files-in-another-user-s-repository/).
The only thing to keep in mind is to prefix the commit message with "docs: ".
The detault commit message generated by Github will lead to a failing CI build.
The default commit message generated by Github will lead to a failing CI build.

For larger updates to the documentation
it might be better to follow the [instructions for contributing code below](#contributing-code).
Expand All @@ -52,7 +52,7 @@ The general steps for creating a pull request are:
1. If you're fixing a bug, be sure to write a test *first*.
That way you can validate that the test actually catches the bug and doesn't pass.
1. Make your changes to the code.
Remember to update the tests if you add new features or change behavior.
Remember to update the tests if you add new features or change behavior.
1. Run the tests via `npm test`. This will also run style checks and other validations.
You might see errors about uncommitted files.
This is expected until you commit your changes.
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
"name": "shared-store",
"version": "2.2.1",
"description": "Keeping config data in sync",
"license": "BSD-3-Clause",
"license": {
"files": [
"src"
]
},
"main": "lib/shared-store.js",
"homepage": "https://github.com/groupon/shared-store",
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/groupon/shared-store"
"url": "https://github.com/groupon/shared-store"
},
"bugs": {
"url": "https://github.com/groupon/shared-store/issues"
Expand Down
2 changes: 2 additions & 0 deletions test/crash-recovery.test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ describe 'Crash recovery', ->
before (done) ->
process.setMaxListeners(99) # repeated process.on('exit') blab warnings
tmp.dir { unsafeCleanup: true }, (err, @tmpDir) => done(err)
return

before ->
# Write known broken config
Expand All @@ -47,6 +48,7 @@ describe 'Crash avoidance', ->
before (done) ->
process.setMaxListeners(99) # repeated process.on('exit') blab warnings
tmp.dir { unsafeCleanup: true }, (err, @tmpDir) => done(err)
return

before ->
# Write invalid JSON config
Expand Down
1 change: 1 addition & 0 deletions test/latest-file.test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe 'latestFile', ->
before (done) ->
@dir = path.join os.tmpdir(), DIR_NAME
rimraf @dir, -> done()
return

describe 'with non-existant directory', ->
before ->
Expand Down
6 changes: 6 additions & 0 deletions test/shared-store/error-handling.test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ describe 'SharedStore (error handling)', ->
tmp.dir { unsafeCleanup: true }, (err, tmpDirParam) ->
tmpDir = tmpDirParam
done(err)
return

it 'will return the error through callback', (done) ->
thrownError = false
Expand All @@ -30,6 +31,7 @@ describe 'SharedStore (error handling)', ->
assert.equal 'This throws!', err.message
done()
null
return

describe 'with a cache', ->
tmpDir = null
Expand All @@ -41,6 +43,7 @@ describe 'SharedStore (error handling)', ->
loader: -> Observable.just {data: 'tastic'}
store.init (storeErr, data) ->
done(storeErr)
return

it 'will return the cache through callback & getCurrent', (done) ->
thrownError = false
Expand All @@ -57,13 +60,15 @@ describe 'SharedStore (error handling)', ->
assert.equal null, err
done()
null
return

describe 'reading from a loader that throws an error after a successful read', ->
tmpDir = null
before (done) ->
tmp.dir { unsafeCleanup: true }, (err, tmpDirParam) ->
tmpDir = tmpDirParam
done(err)
return

it 'will return the error through event handler', (done) ->
thrownError = false
Expand All @@ -84,3 +89,4 @@ describe 'SharedStore (error handling)', ->
store.on 'err', (err) ->
assert.equal '¡Ay, caramba!', err.message
done()
return
5 changes: 5 additions & 0 deletions test/shared-store/index.test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ CHANGED_DATA =
describe 'SharedStore', ->
before (done) ->
tmp.dir { unsafeCleanup: true }, (err, @tmpDir) => done(err)
return

describe 'reading from multiple loaders', ->
before (done) ->
Expand All @@ -35,6 +36,7 @@ describe 'SharedStore', ->
fs.writeFile(
@overrideFile, JSON.stringify(@initialOverrides), done
)
return

before (done) ->
@store = new SharedStore {
Expand All @@ -51,6 +53,7 @@ describe 'SharedStore', ->
}
@store.init opt: 'value', (err, @initCallbackData) => done(err)
null
return

it 'returns the initial data', ->
assert.deepEqual INITIAL_DATA, @store.getCurrent()
Expand Down Expand Up @@ -82,13 +85,15 @@ describe 'SharedStore', ->
assert.deepEqual({ static: 'data' }, @passiveStore.getCurrent())
done()
), 300
return

describe 'after changing a file', ->
before (done) ->
@newOverrides = fromFile: CHANGED_DATA.fromFile
fs.writeFile(
@overrideFile, JSON.stringify(@newOverrides), done
)
return

before (done) -> setTimeout done, 300

Expand Down
2 changes: 2 additions & 0 deletions test/shared-store/retry.test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ SharedStore = require '../../'
describe 'SharedStore (retry functionality)', ->
before (done) ->
tmp.dir { unsafeCleanup: true }, (err, @tmpDir) => done(err)
return

describe 'reading from a loader with a single value', ->
store = null
Expand All @@ -28,3 +29,4 @@ describe 'SharedStore (retry functionality)', ->

assert.equal 2, metaCount
done()
return

0 comments on commit 535aa21

Please sign in to comment.