Permalink
Browse files

fix tag regression, added test for same

  • Loading branch information...
1 parent c4720f3 commit 4f22c7d136fc78ac25a22c7730025d4482ae7716 @rjrodger rjrodger committed Mar 5, 2016
Showing with 20 additions and 7 deletions.
  1. +1 −0 .eslintignore
  2. +1 −1 .eslintrc
  3. +1 −0 .gitignore
  4. +1 −0 .npmignore
  5. +5 −2 lib/optioner.js
  6. +1 −1 test/{seneca-cli.test.js → cli.test.js}
  7. +10 −3 test/seneca.test.js
View
@@ -2,3 +2,4 @@ node_modules
docpad
doc
test/plugin/bad-syntax-plugin.js
+tmp
View
@@ -2,6 +2,6 @@
"extends": "seneca",
"rules": {
"no-return-assign": 2,
- "yoda": 2
+ "yoda": 0
}
}
View
@@ -15,3 +15,4 @@ mem.json
out
testcov.html
.idea
+tmp
View
@@ -1,3 +1,4 @@
*~
*.off
*-off
+tmp
View
@@ -26,7 +26,9 @@ module.exports = function (callmodule, defaults) {
}
if (Fs.existsSync(FATAL_OPTIONS_FILE)) {
- throw error('inverted_file_name', { from: FATAL_OPTIONS_FILE, module: callmodule })
+ throw error('inverted_file_name', {
+ from: FATAL_OPTIONS_FILE, module: callmodule
+ })
}
try {
@@ -77,7 +79,7 @@ module.exports = function (callmodule, defaults) {
sourcemap.argv)
}
- if (argv.seneca.tag !== null) {
+ if (null != argv.seneca.tag) {
sourcemap.argv.tag = '' + argv.seneca.tag
}
@@ -127,6 +129,7 @@ module.exports = function (callmodule, defaults) {
options.log = options.log || options.logger || options.logging || {}
first = false
+
return options
}
@@ -18,7 +18,7 @@ describe('CLI', function () {
it('won\'t display action patterns message when they aren\'t provided', function (done) {
ChildProcess.exec(process.argv[0] + ' ' + launchPath, function (err, stdout, stderr) {
expect(err).to.not.exist()
- expect(stdout).to.not.contain('Seneca')
+ expect(stdout).to.contain('hello')
done()
})
})
View
@@ -29,7 +29,7 @@ var timerstub = {
}
}
-var testopts = { log: 'silent' }
+var testopts = { log: 'test' }
describe('seneca', function () {
lab.beforeEach(function (done) {
@@ -39,6 +39,7 @@ describe('seneca', function () {
process.removeAllListeners('SIGBREAK')
done()
})
+
it('version', function (done) {
var start = Date.now()
var si = Seneca(testopts)
@@ -52,6 +53,12 @@ describe('seneca', function () {
done()
})
+ it('tag', function (done) {
+ var si = Seneca({tag: 'foo'}, testopts)
+ expect(si.id).to.endWith('/foo')
+ done()
+ })
+
it('quick', function (done) {
var si = Seneca(testopts)
si.use(function quickplugin (opts) {
@@ -303,7 +310,7 @@ describe('seneca', function () {
})
it('action-act-invalid-args', function (done) {
- var si = Seneca(testopts)
+ var si = Seneca(testopts, {log: 'silent'})
si.act({op: 'bad', a1: 100}, function (e) {
assert.equal(e.code, 'act_not_found')
@@ -1068,7 +1075,7 @@ describe('seneca', function () {
})
it('sub', function (done) {
- var si = Seneca(testopts, { errhandler: done })
+ var si = Seneca(testopts, { log: 'silent', errhandler: done })
var tmp = {a: 0, as1: 0, as2: 0, as1_in: 0, as1_out: 0, all: 0}

0 comments on commit 4f22c7d

Please sign in to comment.