sequelize-mock icon indicating copy to clipboard operation
sequelize-mock copied to clipboard

Full Core API Mock for Sequelize Object

Open LoveAndCoding opened this issue 9 years ago • 3 comments

The Sequelize object is not mocked out very completely yet. It's got only a select few APIs actually mocked properly. Need to define all the functions that I'm able to mock in the core functionality.


API Calls Remaining

  • [x] .getDialect
  • [x] .getQueryInterface
  • [X] .define
  • [x] .model
  • [x] .isDefined
  • [x] .import
  • [X] .query
  • [ ] .set
  • [ ] .escape
  • [ ] .createSchema
  • [ ] .showAllSchemas
  • [ ] .dropSchema
  • [ ] .dropAllSchemas
  • [x] .sync
  • [ ] .truncate
  • [ ] .drop
  • [x] .authenticate
  • [ ] .fn
  • [ ] .col
  • [ ] .cast
  • [X] .literal
  • [ ] .and
  • [ ] .or
  • [ ] .json
  • [ ] .where
  • [X] .transaction

LoveAndCoding avatar Oct 20 '16 00:10 LoveAndCoding

With the query queue working, could the .fn & .col methods be just no-ops? I'm thinking this would keep things simple.

jagged3dge avatar Jul 19 '17 12:07 jagged3dge

@jagged3dge A lot of these are likely to be no-ops at the end of the day since we don't actually need to do any transformations or escaping for any actual DB queries. But for each I need to go through the API and the code from Sequelize and make sure things are mimicked in a way that makes sense. I want to make sure there is as much parity as possible with Sequelize, even with stuff under the hood, whenever I can.

LoveAndCoding avatar Jul 19 '17 17:07 LoveAndCoding

I want to make sure there is as much parity as possible with Sequelize, even with stuff under the hood, whenever I can

Of course. For now, I've forked this and added no-ops for .col and .fn for my use. Thanks for your insight :+1:

jagged3dge avatar Jul 20 '17 09:07 jagged3dge