{"action":"created","issue":{"url":"https://api.github.com/repos/tunnckoCore/mukla/issues/4","labels_url":"https://api.github.com/repos/tunnckoCore/mukla/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/tunnckoCore/mukla/issues/4/comments","events_url":"https://api.github.com/repos/tunnckoCore/mukla/issues/4/events","html_url":"https://github.com/tunnckoCore/mukla/issues/4","id":64002355,"number":4,"title":"24 March, 2015 - ultimate BDD style API, absolutly expressive and clean","user":{"login":"tunnckoCore","id":5038030,"avatar_url":"https://avatars.githubusercontent.com/u/5038030?v=3","gravatar_id":"","url":"https://api.github.com/users/tunnckoCore","html_url":"https://github.com/tunnckoCore","followers_url":"https://api.github.com/users/tunnckoCore/followers","following_url":"https://api.github.com/users/tunnckoCore/following{/other_user}","gists_url":"https://api.github.com/users/tunnckoCore/gists{/gist_id}","starred_url":"https://api.github.com/users/tunnckoCore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tunnckoCore/subscriptions","organizations_url":"https://api.github.com/users/tunnckoCore/orgs","repos_url":"https://api.github.com/users/tunnckoCore/repos","events_url":"https://api.github.com/users/tunnckoCore/events{/privacy}","received_events_url":"https://api.github.com/users/tunnckoCore/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-24T14:03:10Z","updated_at":"2015-03-24T19:28:03Z","closed_at":null,"body":"Soooo... this mocha + should approach\r\n\r\n```js\r\ndescribe('kindOf', function () {\r\n  describe('null and undefined', function () {\r\n    it('should work for undefined', function () {\r\n      kindOf(undefined).should.equal('undefined');\r\n    });\r\n\r\n    it('should work for null', function () {\r\n      kindOf(null).should.equal('null');\r\n    });\r\n  });\r\n\r\n  describe('primitives', function () {\r\n    it('should work for booleans', function () {\r\n      kindOf(true).should.equal('boolean');\r\n      kindOf(false).should.equal('boolean');\r\n      kindOf(new Boolean(true)).should.equal('boolean');\r\n    });\r\n\r\n    it('should work for numbers', function () {\r\n      kindOf(42).should.equal('number');\r\n      kindOf(new Number(42)).should.equal('number');\r\n    });\r\n\r\n    it('should work for strings', function () {\r\n      kindOf('str').should.equal('string');\r\n      kindOf(new String('str')).should.equal('string');\r\n    });\r\n  });\r\n\r\n  describe('objects', function () {\r\n    it('should work for arguments', function () {\r\n      kindOf(arguments).should.equal('arguments');\r\n    });\r\n\r\n    it('should work for buffers', function () {\r\n      kindOf(new Buffer('')).should.equal('buffer');\r\n    });\r\n\r\n    it('should work for objects', function () {\r\n      function Test() {}\r\n      var instance = new Test();\r\n      var literal = {};\r\n      var create = Object.create(null);\r\n\r\n      kindOf(instance).should.equal('object');\r\n      kindOf(literal).should.equal('object');\r\n      kindOf(create).should.equal('object');\r\n    });\r\n\r\n    it('should work for dates', function () {\r\n      kindOf(new Date()).should.equal('date');\r\n    });\r\n\r\n    it('should work for arrays', function () {\r\n      kindOf([]).should.equal('array');\r\n      kindOf([1, 2, 3]).should.equal('array');\r\n      kindOf(new Array()).should.equal('array');\r\n    });\r\n\r\n    it('should work for regular expressions', function () {\r\n      kindOf(/[\\s\\S]+/).should.equal('regexp');\r\n      kindOf(new RegExp('^' + 'foo$')).should.equal('regexp');\r\n    });\r\n\r\n    it('should work for functions', function () {\r\n      kindOf(function () {}).should.equal('function');\r\n      kindOf(new Function()).should.equal('function');\r\n    });\r\n  });\r\n});\r\n```\r\nwill become like this mukla + assertion library (built in assume / `npm.im/assume@v2 or v3`)\r\n\r\n```js\r\nmukla('kind-of and koa-better-ratelimit tests')\r\n\r\n// start using `assume` as assertion library\r\n.use(assume)\r\n.describe('null and undefined')\r\n  .it('should work for undefined').and\r\n    .assume(kindOf(undefined)).equal('undefined')\r\n  .done.it()\r\n  .it('should work for null').and\r\n    .assume(kindOf(null)).equal('null')\r\n  .done.it()\r\n.described() // closes `null and undefined` describe\r\n\r\n// add `expect` as assertion library,\r\n// now you can use both `assume` and `expect`, plus builtin `enhanced assert`\r\n.use(expect)\r\n.describe('primitives')\r\n  .it('should work for booleans').and\r\n    .expect(kindOf(true)).to.be.equal('boolean')\r\n    .expect(kindOf(false)).to.be.equal('boolean')\r\n    .expect(kindOf(new Boolean(true))).to.be.equal('boolean')\r\n  .done.it()\r\n  .it('should work for numbers')\r\n    .expect(kindOf(42)).to.be.equal('number')\r\n    .expect(kindOf(new Number(42))).to.be.equal('number')\r\n  .done.it()\r\n  .it('should work for strings').and\r\n    .expect(kindOf('str')).to.be.equal('string')\r\n    .expect(kindOf(new String('str'))).to.be.equal('string')\r\n  .done.it()\r\n.described() // closes `primitives` describe\r\n\r\n.describe('objects')\r\n  .it('should work for arguments').and\r\n    .assume(kindOf(arguments)).equal('arguments')\r\n  .done.it()\r\n\r\n  .it('should work for buffers').and\r\n    .expect(kindOf(new Buffer(''))).to.be.equal('buffer')\r\n  .done.it()\r\n\r\n  .it('should work for objects', function(ctx) {\r\n    function Test() {}\r\n    var instance = new Test();\r\n    var literal = {};\r\n    var create = Object.create(null);\r\n\r\n    ctx\r\n      .assume(kindOf(instance)).equal('object')\r\n      .assume(kindOf(literal)).equal('object')\r\n      .assume(kindOf(create)).equal('object');\r\n\r\n    ctx.done.it();\r\n  })\r\n\r\n  .it('should work for dates')\r\n    .assume(kindOf(new Date())).equal('date')\r\n  .done.it()\r\n\r\n  .it('should work for arrays')\r\n    .expect([1,2,3]).to.be.deep.equal([1,2,3])\r\n    .assume(kindOf([])).equal('array')\r\n    .assume(kindOf([1, 2, 3])).equal('array')\r\n    .assume(kindOf(new Array())).equal('array')\r\n  .done.it()\r\n\r\n  .it('should work for regular expressions')\r\n    .assume(kindOf(/[\\s\\S]+/)).equal('regexp')\r\n    .assume(kindOf(new RegExp('^' + 'foo$'))).equal('regexp')\r\n  .done.it()\r\n\r\n  it('should work for functions', function () {\r\n    .assume(kindOf(function () {})).equal('function')\r\n    .assume(kindOf(new Function())).equal('function')\r\n  .done.it()\r\n.described() // closes `objects` describe\r\n\r\n// koa-better-ratelimit use case\r\n\r\n// start using `supertest` as assertion library;\r\n// here u can use also `assume`\r\n.use(supertest)\r\n.describe('appNonDefault')\r\n  .it('should status 200 - 1.2.3.4 - remaining 2/3')\r\n    .supertest(appNonDefault)\r\n      .get('/')\r\n      .set('x-koaip', '1.2.3.4')\r\n      .expect(200, '<p>Hello test.</p>')\r\n      .expect('X-RateLimit-Limit', '3')\r\n      .expect('X-RateLimit-Remaining', '2')\r\n      .end(function _end(err, res, ctx) {\r\n        // there is enhanced `assert` out of the box\r\n        // in this case you will have `assume`, `supertest`\r\n        // and `enhanced assert` here\r\n        ctx\r\n          .assert.ifError(err)\r\n          .assert.strictEqual(res.text, '<p>Hello test.</p>')\r\n          .assert(res.type).strict.equal('text/html')\r\n          .done.it();\r\n      })\r\n.described()\r\n\r\n.describe('appWhiteList')\r\n  .it('should 200 OK - whiteList - no limits')\r\n    .supertest(appWhite)\r\n      .get('/')\r\n      .set('x-koaip', '127.0.4.4')\r\n      .expect(200, '<p>Hello test.</p>')\r\n      // .done.it() - possibility #1,\r\n      // `.done.it()` is injected when you add `supertest` with `.use`\r\n      // it is exactly as below\r\n\r\n      // below is possibility #2\r\n      // it is same as old but with 3rd param `this` of mukla\r\n      // to access all sugar\r\n      .end(function _end(err, res, ctx) {\r\n        ctx.done.it();\r\n      })\r\n.described()\r\n\r\n.end() // ending `mukla` (maybe optional?)\r\n```"},"comment":{"url":"https://api.github.com/repos/tunnckoCore/mukla/issues/comments/85659057","html_url":"https://github.com/tunnckoCore/mukla/issues/4#issuecomment-85659057","issue_url":"https://api.github.com/repos/tunnckoCore/mukla/issues/4","id":85659057,"user":{"login":"tunnckoCore","id":5038030,"avatar_url":"https://avatars.githubusercontent.com/u/5038030?v=3","gravatar_id":"","url":"https://api.github.com/users/tunnckoCore","html_url":"https://github.com/tunnckoCore","followers_url":"https://api.github.com/users/tunnckoCore/followers","following_url":"https://api.github.com/users/tunnckoCore/following{/other_user}","gists_url":"https://api.github.com/users/tunnckoCore/gists{/gist_id}","starred_url":"https://api.github.com/users/tunnckoCore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tunnckoCore/subscriptions","organizations_url":"https://api.github.com/users/tunnckoCore/orgs","repos_url":"https://api.github.com/users/tunnckoCore/repos","events_url":"https://api.github.com/users/tunnckoCore/events{/privacy}","received_events_url":"https://api.github.com/users/tunnckoCore/received_events","type":"User","site_admin":false},"created_at":"2015-03-24T19:28:03Z","updated_at":"2015-03-24T19:28:03Z","body":"updated example"}}