diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d3ee4b56..00000000 --- a/.travis.yml +++ /dev/null @@ -1,35 +0,0 @@ -language: node_js - -node_js: - - '14' - - '13' - - '12' - - '10' - -env: - global: - - TIMEOUT_MULTIPLIER=8 - -install: - - npm ci - -script: - - npm test - - > - if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then - npm audit - npm run coveralls - rm -rf node_modules - npm ci --only=production - ./test/smoke-test.sh; - ./test/entity-test.sh; - ./test/joi-test.sh; - ./test/doc-test.sh; - fi - - -os: - - "linux" - - "osx" - - "windows" - diff --git a/CHANGES.md b/CHANGES.md index b0943c45..513cd780 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,8 @@ +## 3.33.0 2023-11-05 + +* Remove norma library, replace functionality with update gubu library. + + ## 3.32.1 2023-09-16 * Provide Seneca 4 act-err argument variants via `act-err-4` temporary event. diff --git a/lib/ready.js b/lib/ready.js index 54e6cf1f..870ef769 100644 --- a/lib/ready.js +++ b/lib/ready.js @@ -18,6 +18,7 @@ function make_ready(root) { }; } exports.make_ready = make_ready; +// TODO should callback with plugin errs, or throw them! function api_ready(ready_func) { var self = this; // Allow pending actions to complete diff --git a/lib/ready.js.map b/lib/ready.js.map index 1917156b..d64f34fe 100644 --- a/lib/ready.js.map +++ b/lib/ready.js.map @@ -1 +1 @@ -{"version":3,"file":"ready.js","sourceRoot":"","sources":["ready.ts"],"names":[],"mappings":";AAAA,+EAA+E;;;AAG/E,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AAElC,iCAAiC;AACjC,wCAAwC;AACxC,qEAAqE;AACrE,SAAS,UAAU,CAAC,IAAS;IAC3B,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;IAE5B,8BAA8B;IAC9B,QAAQ,CAAC,aAAa,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAA;IAC1C,QAAQ,CAAC,UAAU,GAAG,EAAE,CAAA;IAExB,OAAO;Q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AACH,CAAC"} \ No newline at end of file diff --git a/package.json b/package.json index 7ddde48d..e4d969cb 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,7 @@ "@hapi/lab": "25", "@seneca/test-plugin": "0.1.0", "@types/node": "^20.8.10", - "async": "^3.2.4", + "async": "^3.2.5", "bench": "^0.3.6", "coveralls": "^3.1.1", "gex": "^4.0.1", diff --git a/test/add.test.js b/test/add.test.js index 9aaa8613..9cfffa36 100644 --- a/test/add.test.js +++ b/test/add.test.js @@ -17,29 +17,59 @@ describe('add', function () { it('args', function (fin) { const si = Seneca().test() si - // First can be jsonic - .add({a:1}, function a1(msg,reply){reply({x:1})}) - .add('a:2', function a2(msg,reply){reply({x:2})}) + // First can be jsonic + .add({ a: 1 }, function a1(msg, reply) { + reply({ x: 1 }) + }) + .add('a:2', function a2(msg, reply) { + reply({ x: 2 }) + }) - // Second is always an object. - .add({a:3}, {b:1}, function a3b1(msg,reply){reply({x:3})}) - .add('a:4', {b:2}, function a4b2(msg,reply){reply({x:4})}) + // Second is always an object. + .add({ a: 3 }, { b: 1 }, function a3b1(msg, reply) { + reply({ x: 3 }) + }) + .add('a:4', { b: 2 }, function a4b2(msg, reply) { + reply({ x: 4 }) + }) - // Sub patterns don't need an action. - .add({a:5}) + // Sub patterns don't need an action. + .add({ a: 5 }) .add('a:6') - .add({a:7}) - .add('a:8', {b:5}) - - .add({a:9}, - function a9(msg,reply){reply({x:9})},{plugin_name:'p9'}) - .add('a:10', - function a10(msg,reply){reply({x:10})},{plugin_name:'p10'}) - .add({a:11}, {b:6}, - function a11b6(msg,reply){reply({x:11})},{plugin_name:'p11'}) - .add('a:12', {b:7}, - function a12b7(msg,reply){reply({x:12})},{plugin_name:'p12'}) - + .add({ a: 7 }) + .add('a:8', { b: 5 }) + + .add( + { a: 9 }, + function a9(msg, reply) { + reply({ x: 9 }) + }, + { plugin_name: 'p9' }, + ) + .add( + 'a:10', + function a10(msg, reply) { + reply({ x: 10 }) + }, + { plugin_name: 'p10' }, + ) + .add( + { a: 11 }, + { b: 6 }, + function a11b6(msg, reply) { + reply({ x: 11 }) + }, + { plugin_name: 'p11' }, + ) + .add( + 'a:12', + { b: 7 }, + function a12b7(msg, reply) { + reply({ x: 12 }) + }, + { plugin_name: 'p12' }, + ) + let pats = si.list('a:*') // console.log(pats) expect(pats).equal([ @@ -54,43 +84,43 @@ describe('add', function () { { a: '9' }, { a: '10' }, { a: '11', b: '6' }, - { a: '12', b: '7' } + { a: '12', b: '7' }, ]) - - si.act('a:1', function(err, out) { + + si.act('a:1', function (err, out) { expect(err).equal(null) - expect(out).equal({x:1}) + expect(out).equal({ x: 1 }) - si.act('a:2', function(err, out) { + si.act('a:2', function (err, out) { expect(err).equal(null) - expect(out).equal({x:2}) + expect(out).equal({ x: 2 }) - si.act('a:3,b:1', function(err, out) { + si.act('a:3,b:1', function (err, out) { expect(err).equal(null) - expect(out).equal({x:3}) + expect(out).equal({ x: 3 }) - si.act('a:4,b:2', function(err, out) { + si.act('a:4,b:2', function (err, out) { expect(err).equal(null) - expect(out).equal({x:4}) + expect(out).equal({ x: 4 }) - si.act('a:9', function(err, out, meta) { + si.act('a:9', function (err, out, meta) { expect(err).equal(null) - expect(out).equal({x:9}) + expect(out).equal({ x: 9 }) expect(meta.plugin.name).equal('p9') - si.act('a:10', function(err, out, meta) { + si.act('a:10', function (err, out, meta) { expect(err).equal(null) - expect(out).equal({x:10}) + expect(out).equal({ x: 10 }) expect(meta.plugin.name).equal('p10') - si.act('a:11,b:6', function(err, out, meta) { + si.act('a:11,b:6', function (err, out, meta) { expect(err).equal(null) - expect(out).equal({x:11}) + expect(out).equal({ x: 11 }) expect(meta.plugin.name).equal('p11') - si.act('a:12,b:7', function(err, out, meta) { + si.act('a:12,b:7', function (err, out, meta) { expect(err).equal(null) - expect(out).equal({x:12}) + expect(out).equal({ x: 12 }) expect(meta.plugin.name).equal('p12') fin() @@ -107,14 +137,14 @@ describe('add', function () { it('args-error', function (fin) { const si = Seneca().test() - expect(()=>si.add('a','b')) - .throw('seneca (add): Validation failed for property "actdef"'+ - ' with string "b" because the string is not of type object.') + expect(() => si.add('a', 'b')).throw( + 'seneca (add): Validation failed for property "actdef"' + + ' with string "b" because the string is not of type object.', + ) fin() }) - - + it('action-name', function (fin) { var si = Seneca().test() @@ -193,9 +223,10 @@ describe('add', function () { expect(e).exist() expect(o).not.exist() expect(e.code).equal('act_invalid_msg') - expect(e.details.props) - .equal([{ path: 'b', what: 'type', type: 'number', value: 'x' }]) - + expect(e.details.props).equal([ + { path: 'b', what: 'type', type: 'number', value: 'x' }, + ]) + si.act({ a: 2, b: 3 }, function (e, o) { expect(e).not.exist() expect(o).equal({ b: 9 }) @@ -204,8 +235,9 @@ describe('add', function () { expect(e).exist() expect(o).not.exist() expect(e.code).equal('act_invalid_msg') - expect(e.details.props) - .equal([{ path: 'b', what: 'type', type: 'number', value: 'x' }]) + expect(e.details.props).equal([ + { path: 'b', what: 'type', type: 'number', value: 'x' }, + ]) fin() }) diff --git a/test/common.test.js b/test/common.test.js index 33a03bb3..2ceed315 100644 --- a/test/common.test.js +++ b/test/common.test.js @@ -17,10 +17,10 @@ var it = Shared.make_it(lab) describe('common', function () { it('stringify', function (fin) { expect(Common.stringify({})).equal('{}') - expect(Common.stringify({a:1})).equal('{"a":1}') + expect(Common.stringify({ a: 1 })).equal('{"a":1}') fin() }) - + it('misc', function (fin) { expect(Common.boolify(true)).to.equal(true) expect(Common.boolify(false)).to.equal(false) diff --git a/test/delegation.test.js b/test/delegation.test.js index 64b74acf..c72fbccd 100644 --- a/test/delegation.test.js +++ b/test/delegation.test.js @@ -25,7 +25,7 @@ describe('delegation', function () { }) var sid = si.delegate({ a$: 'A', b: 'B' }) // console.log('SID', sid) - + assert.ok(Gex('Seneca/*.*.*/*').on(si.toString())) assert.ok(Gex('Seneca/*.*.*/*/{b:B}').on(sid.toString())) diff --git a/test/inward.test.js b/test/inward.test.js index 831a9173..871998af 100644 --- a/test/inward.test.js +++ b/test/inward.test.js @@ -42,18 +42,18 @@ describe('inward', function () { try { API.inward() expect(false).true() - } - catch (e) { - expect(e.message) - .equal('seneca: Validation failed for property "inward"'+ - ' with value "undefined" because the value is required.') - expect({...e}).includes({ + } catch (e) { + expect(e.message).equal( + 'seneca: Validation failed for property "inward"' + + ' with value "undefined" because the value is required.', + ) + expect({ ...e }).includes({ gubu: true, code: 'shape', }) expect(e.props[0]).includes({ - path:'inward', - type:'function' + path: 'inward', + type: 'function', }) } diff --git a/test/legacy.test.js b/test/legacy.test.js index 9a69352e..908ae494 100644 --- a/test/legacy.test.js +++ b/test/legacy.test.js @@ -131,7 +131,6 @@ describe('legacy', function () { }) }) - it('act_if', function (done) { var si = Seneca({ log: 'silent' }) @@ -158,12 +157,11 @@ describe('legacy', function () { expect(true).equal(false) }) expect(true).equal(false) - } - catch (e) { + } catch (e) { expect(e.message).match(/not of type boolean/) } - si = Seneca({log:'test'}) + si = Seneca({ log: 'test' }) .add('a:1', function (msg, reply) { reply({ b: msg.a + 1 }) }) @@ -182,5 +180,4 @@ describe('legacy', function () { process.nextTick(done) }) }) - }) diff --git a/test/outward.test.js b/test/outward.test.js index 938715ea..970ea26d 100644 --- a/test/outward.test.js +++ b/test/outward.test.js @@ -56,18 +56,18 @@ describe('outward', function () { try { API.outward() expect(false).true() - } - catch (e) { - expect(e.message) - .equal('seneca: Validation failed for property "outward"'+ - ' with value "undefined" because the value is required.') - expect({...e}).includes({ + } catch (e) { + expect(e.message).equal( + 'seneca: Validation failed for property "outward"' + + ' with value "undefined" because the value is required.', + ) + expect({ ...e }).includes({ gubu: true, code: 'shape', }) expect(e.props[0]).includes({ - path:'outward', - type:'function' + path: 'outward', + type: 'function', }) } diff --git a/test/plugin.test.js b/test/plugin.test.js index fbc1c89d..5287772e 100644 --- a/test/plugin.test.js +++ b/test/plugin.test.js @@ -449,7 +449,7 @@ describe('plugin', function () { fin() }) .use(function foo() { - this.add('a','b') + this.add('a', 'b') }) }) diff --git a/test/quick.js b/test/quick.js index 97f9a2b8..e5d2e123 100644 --- a/test/quick.js +++ b/test/quick.js @@ -14,7 +14,7 @@ let s0 = Seneca({ // action: false, // }, // }, - system:{action:{add:false}}, + system: { action: { add: false } }, }) .test() // .use('entity') @@ -31,7 +31,7 @@ let s0 = Seneca({ // console.log('FOO_INTERCEPTOR', actcall) // } // }, Seneca.util.print) - .add({a:1}, function a1(msg, reply) { + .add({ a: 1 }, function a1(msg, reply) { reply({ x: msg.x }) }) // .add('b:1', function a1(msg, reply) { diff --git a/test/seneca.test.js b/test/seneca.test.js index c156a420..3c21769d 100644 --- a/test/seneca.test.js +++ b/test/seneca.test.js @@ -239,7 +239,6 @@ describe('seneca', function () { }) }) - it('action-act-invalid-args', function (done) { const si = Seneca(testopts).test().quiet() @@ -253,8 +252,7 @@ describe('seneca', function () { try { si.act(null, function (e) {}) expect(true).false() - } - catch(e) { + } catch (e) { expect('shape').equal(e.code) done() } @@ -262,7 +260,6 @@ describe('seneca', function () { }) }) - it('action-default', function (done) { var si = Seneca(testopts).error(done) @@ -544,7 +541,6 @@ describe('seneca', function () { }) }) - it('loading-plugins', function (done) { var si = Seneca().test() @@ -626,7 +622,6 @@ describe('seneca', function () { done() }) - it('strargs', function (done) { const si = Seneca({ strict: { result: false } }) .test(done) @@ -641,7 +636,7 @@ describe('seneca', function () { si.act('a:1,b:2,c:3', function (err, out) { expect(!err).true() expect(out).equal(6) - + si.act('a:1,b:2', function (err, out) { expect(!err).true() expect(out).equal(2) @@ -650,35 +645,34 @@ describe('seneca', function () { si.add('a::2', function (args, cb) { cb() }) - } - catch (e) { + } catch (e) { expect('add_string_pattern_syntax', e.code) - + try { si.act('a::2', { c: 3 }, function () { expect(true).false() }) - } - catch (e) { + } catch (e) { expect(e.code).equal('msg_jsonic_syntax') try { si.add('a:1,b:2', 'bad-arg', function (args, cb) { cb() }) - } - catch (e) { - expect(e.message) - .equal('seneca (add): Validation failed for property "actdef" '+ - 'with string "bad-arg" because the string is not of type object.') - + } catch (e) { + expect(e.message).equal( + 'seneca (add): Validation failed for property "actdef" ' + + 'with string "bad-arg" because the string is not of type object.', + ) + try { si.add(123, function (args, cb) { cb() }) - } - catch (e) { - expect(e.message).equal('seneca (add): Value "123" for property "props" does not satisfy one of: string, Object') + } catch (e) { + expect(e.message).equal( + 'seneca (add): Value "123" for property "props" does not satisfy one of: string, Object', + ) done() } } @@ -1014,7 +1008,7 @@ describe('seneca', function () { }) }) - it('decorate-basic', async ()=> { + it('decorate-basic', async () => { const si = Seneca().test().quiet() si.decorate('foo', function () { expect(this === si) @@ -1024,23 +1018,26 @@ describe('seneca', function () { expect(si.foo()).equals('bar') }) - it('decorate-core-property', async ()=> { + it('decorate-core-property', async () => { const si = Seneca().test().quiet() - expect(()=>si.decorate('add',()=>{})) - .throws('seneca: Decoration overrides core property:add') + expect(() => si.decorate('add', () => {})).throws( + 'seneca: Decoration overrides core property:add', + ) }) - it('decorate-overwrite', async ()=>{ + it('decorate-overwrite', async () => { const si = Seneca().test().quiet() - si.decorate('foo', ()=>{}) - expect(()=>si.decorate('foo',()=>{})) - .throws('seneca: Decoration already exists: foo') + si.decorate('foo', () => {}) + expect(() => si.decorate('foo', () => {})).throws( + 'seneca: Decoration already exists: foo', + ) }) - it('decorate-underscore-prefix', async ()=>{ + it('decorate-underscore-prefix', async () => { const si = Seneca().test().quiet() - expect(()=>si.decorate('_use')) - .throws('seneca: Decorate property cannot start with underscore (was _use)') + expect(() => si.decorate('_use')).throws( + 'seneca: Decorate property cannot start with underscore (was _use)', + ) }) it('supports jsonic params to has', function (done) {