Bug occurred about setting a custom timezone is not supported
I use sequelize version 5.19.2. and use mysql. and set-up like below code. There is in test file
const Database = require('../../models').sequelize;
sequelizeMockingMocha(
Database,
path.resolve(path.join(__dirname, '../fake-trainer-database.json')),
{'logging': console.log}
);
There is in model set-up file
let sequelize;
if (config.use_env_variable) {
sequelize = new Sequelize(process.env[config.use_env_variable], config);
} else {
sequelize = new Sequelize(config.database, config.username, config.password, config);
}
...
db.sequelize = sequelize;
db.Sequelize = Sequelize;
db.Trainer = require('./trainer')(sequelize, Sequelize);
I don't know why this error happened. Are there error in my code? plz help me.
Error: Setting a custom timezone is not supported by SQLite, dates are always returned as UTC. Please remove the custom timezone parameter.
at new Sequelize (node_modules/sequelize/lib/sequelize.js:273:13)
at Function.create (node_modules/sequelize-mocking/lib/sequelize-mocking.js:95:31)
at createAndLoadFixtureFile (node_modules/sequelize-mocking/lib/sequelize-mocking.js:123:14)
at wrapper (node_modules/sequelize-mocking/node_modules/lodash/lodash.js:5193:19)
at Context.<anonymous> (node_modules/sequelize-mocking/lib/sequelize-mocking-mocha.js:33:13)
at processImmediate (internal/timers.js:439:21)
at process.topLevelDomainCallback (domain.js:126:23)
TypeError: Cannot read property '__originalSequelize' of null
at Function.unhookNewModel (node_modules/sequelize-mocking/lib/sequelize-mocking.js:277:29)
at Function.restore (node_modules/sequelize-mocking/lib/sequelize-mocking.js:249:26)
at Context.<anonymous> (node_modules/sequelize-mocking/lib/sequelize-mocking-mocha.js:43:18)
at processImmediate (internal/timers.js:439:21)
at process.topLevelDomainCallback (domain.js:126:23)
Hi @BaeJi77 Could you provide a tiny zip with a sample to illustrate your issue? What is the provided "config" object? Here a thread around timezone and sequelize: https://github.com/sequelize/sequelize/issues/854 Regards
i met the same question, and the error tips like this ------------Setting a custom timezone is not supported by SQLite, dates are always returned as UTC. Please remove the custom timezone parameter-------- need help ?