From ac88d4f5947dce05140ad306addf162c706e2603 Mon Sep 17 00:00:00 2001 From: mmkal Date: Sun, 5 Jul 2020 23:49:48 +0100 Subject: [PATCH] fix: remove sequelize-6-only property --- .github/workflows/ci.yml | 11 ++++------- test/storage/sequelize.test.ts | 7 ++++++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2232396d..fc28c630 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,15 +14,12 @@ jobs: 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 diff --git a/test/storage/sequelize.test.ts b/test/storage/sequelize.test.ts index f71072a8..fd8e8494 100644 --- a/test/storage/sequelize.test.ts +++ b/test/storage/sequelize.test.ts @@ -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); + return d; + }); describe('sequelize', () => { jetpack.cwd(__dirname).dir('tmp', { empty: true });