Skip to content

Commit

Permalink
added json type field test
Browse files Browse the repository at this point in the history
  • Loading branch information
ponury-kostek committed Jul 12, 2018
1 parent f26d5b2 commit b8f3c01
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,25 @@ describe("CRUD", () => {
});
});
});
it("get json type", (done) => {
let mule = new AMule();
const json = {a:1,b:true,c:null,d:[1,2.3,4,{}]};
mule.use(new Myro(connection));
mule.has("tbl_json", 42, function (err, has) {
assert.strictEqual(err, null);
assert.strictEqual(has, false);
connection.query("INSERT INTO `tbl_json` SET `id`=42, `value`='" + JSON.stringify(json) + "'", (err) => {
if (err) {
return done(err);
}
mule.get("tbl_json", 42, function (err, res) {
assert.strictEqual(err, null);
assert.deepStrictEqual(res.value, json);
done();
});
});
});
});
it("delete with readOnly:true", (done) => {
let mule = new AMule();
mule.use(new Myro(connection));
Expand Down

0 comments on commit b8f3c01

Please sign in to comment.