@northernv/supermodel
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -177,1 +177,15 @@ const k = require('knex') | ||
}) | ||
describe('count', () => { | ||
it('should fail when no knex object given', () => { | ||
expect(() => Fake.count({ name: 'none' })).toThrow() | ||
}) | ||
it('should return a single value integer', async () => { | ||
tracker.on('query', (query) => { | ||
query.response([ { count: 123 } ]) | ||
}) | ||
const res = await Fake.count({ n: 1 }, { db }) | ||
expect(res).toEqual(123) | ||
}) | ||
}) |
@@ -261,3 +261,3 @@ const assert = require('assert') | ||
.select() | ||
.count('id') | ||
.count('*') | ||
.where(where) | ||
@@ -264,0 +264,0 @@ |
{ | ||
"name": "@northernv/supermodel", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "A Base model for Knex", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
## @northernv/supermodel | ||
[![npm](https://img.shields.io/npm/v/@northernv/supermodel.svg?maxAge=2592000)](https://www.npmjs.com/package/@northernv/supermodel) | ||
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/mathewdgardner/knex-supermodel/master/LICENSE) | ||
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitlab.com/shanestillwell/supermodel/raw/master/LICENSE) | ||
@@ -6,0 +6,0 @@ Completely inspired by [knex-supermodel](https://www.npmjs.com/package/knex-supermodel), just altered with some personal modifications to meet my needs |
25786
12
686