Skip to content

Commit

Permalink
test: add null query test case (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
guoshencheng authored and fengmk2 committed Jan 17, 2019
1 parent b0dd988 commit 89910f6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/mysql.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ describe('test/mysql.test.js', () => {
assert(row.id === user.id);
});

it('should query one desc is NULL success', function* () {
const user = yield app.mysql.queryOne('select * from npm_auth where `desc` is NULL');
assert(user);
assert(typeof user.user_id === 'string' && user.user_id);

const row = yield app.mysql.get('npm_auth', { desc: null });
assert(row.id === user.id);
});

it('should query one not exists return null', function* () {
let user = yield app.mysql.queryOne('select * from npm_auth where id = -1');
assert(!user);
Expand Down

0 comments on commit 89910f6

Please sign in to comment.