Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: workaround sequelize types in tests #226

Merged
merged 5 commits into from
May 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions test/storage/sequelize.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import { join } from 'path';
import { v4 as uuid } from 'uuid';
import jetpack = require('fs-jetpack');

// TODO [>=3.0.0]: Investigate whether we are mis-using `model.describe()` here, and get rid of `any`.
// See https://github.com/sequelize/umzug/pull/226 and https://github.com/sequelize/sequelize/issues/12296 for details
const describeModel = (model: any) => model.describe();

describe('sequelize', () => {
jetpack.cwd(__dirname).dir('tmp', { empty: true });

Expand Down Expand Up @@ -43,7 +47,7 @@ describe('sequelize', () => {
expect(storage.model.getTableName()).toBe('SequelizeMeta');
return storage.model
.sync()
.then(model => model.describe())
.then(describeModel)
.then(description => {
expect(description).toMatchInlineSnapshot(`
Object {
Expand Down Expand Up @@ -90,7 +94,7 @@ describe('sequelize', () => {
});
return storage.model
.sync()
.then(model => model.describe())
.then(describeModel)
.then(description => {
expect(description).toMatchInlineSnapshot(`
Object {
Expand All @@ -112,7 +116,7 @@ describe('sequelize', () => {
});
return storage.model
.sync()
.then(model => model.describe())
.then(describeModel)
.then(description => {
expect(description).toMatchInlineSnapshot(`
Object {
Expand Down Expand Up @@ -146,7 +150,7 @@ describe('sequelize', () => {
});
return storage.model
.sync()
.then(model => model.describe())
.then(describeModel)
.then(description => {
expect(description.name.type).toBe('VARCHAR(190)');
// Expect(description.name.defaultValue).to.be.oneOf([null, undefined])
Expand Down