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: sequelize latest #232

Merged
merged 2 commits into from
Jul 5, 2020
Merged
Show file tree
Hide file tree
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
13 changes: 5 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,19 @@ jobs:
strategy:
matrix:
node-version: [12.x, 10.x]
sequelize-version: [null, next]
sequelize-version: [null, latest]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm install sequelize@${{ matrix.sequelize-version }}
if: matrix.sequelize-version != null
- name: run ci
run: |
npm install
npm run lint
npm run test -- --coverage
env:
CI: true
- run: npm run lint
if: matrix.sequelize-version == null
- run: npm run test -- --coverage
- name: Coverage
uses: codecov/codecov-action@v1
if: matrix.node-version == '12.x' && matrix.sequelize-version == null
7 changes: 6 additions & 1 deletion test/storage/sequelize.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ 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();
const describeModel = (model: any) =>
model.describe().then(d => {
// FIXME [sequelize@>=6] remove this hack when only sequelize>=6 is supported
Object.keys(d).forEach(k => delete d[k].unique);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Odd, why is this being done?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're asserting in a few places on the output of this function. The new version of sequelize includes an extra property unique. So that tests pass for old and new sequelize, this deletes it.

return d;
});

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