From 61507a89e587ef77564e688784079b7002a37220 Mon Sep 17 00:00:00 2001 From: mystylelee Date: Fri, 11 Feb 2022 12:35:59 +0900 Subject: [PATCH] test: [test/specs/instance.spec.ts] - Model.reload() method is return Model, Deprecated: Operator Aliases --- test/specs/instance.spec.ts | 2 +- test/specs/models/sequelize.spec.ts | 7 ------- test/specs/repository-mode.spec.ts | 8 -------- test/specs/unique.spec.ts | 2 -- test/utils/sequelize.ts | 3 --- 5 files changed, 1 insertion(+), 21 deletions(-) diff --git a/test/specs/instance.spec.ts b/test/specs/instance.spec.ts index 8b667fc9..4cbf05f9 100644 --- a/test/specs/instance.spec.ts +++ b/test/specs/instance.spec.ts @@ -686,7 +686,7 @@ describe('instance', () => { leTeam.players[0].destroy(); // Since destroy return void now return leTeam; }) - .then((leTeam) => leTeam.reload() as any) + .then((leTeam) => leTeam.reload()) .then((leTeam: Team) => { expect(leTeam.players).to.have.length(1); }) diff --git a/test/specs/models/sequelize.spec.ts b/test/specs/models/sequelize.spec.ts index dfa8d2fa..f673a737 100644 --- a/test/specs/models/sequelize.spec.ts +++ b/test/specs/models/sequelize.spec.ts @@ -11,7 +11,6 @@ import ShoeDir from '../../models/globs/match-dir-only/ShoeDir'; import { Table } from '../../../src/model/table/table'; import { Match } from '../../models/exports/custom-match/match.model'; import { Model, Sequelize } from '../../../src'; -import { Op } from 'sequelize'; import { join } from 'path'; import { AddressDir } from '../../models/globs/match-files/AddressDir'; import { UserDir } from '../../models/globs/match-files/UserDir'; @@ -45,7 +44,6 @@ describe('sequelize', () => { describe('constructor: using "name" property as a db name', () => { const db = '__'; const sequelizeDbName = new Sequelize({ - operatorsAliases: Op, database: db, dialect: 'sqlite', username: 'root', @@ -68,7 +66,6 @@ describe('sequelize', () => { describe('constructor using uri in options object', () => { const sequelizeUri = new Sequelize(connectionUri, { - operatorsAliases: Op, storage: ':memory:', logging: !('DISABLE_LOGGING' in process.env), pool: { max: 8, min: 0 }, @@ -254,7 +251,6 @@ describe('sequelize', () => { it('should load classes from subfolders matching glob criteria', () => { const db = '__'; const sequelizeGlob = new Sequelize({ - operatorsAliases: Op, database: db, dialect: 'sqlite', username: 'root', @@ -272,7 +268,6 @@ describe('sequelize', () => { it('should load classes from folders', () => { const db = '__'; const sequelizeFolder = new Sequelize({ - operatorsAliases: Op, database: db, dialect: 'sqlite', username: 'root', @@ -290,7 +285,6 @@ describe('sequelize', () => { it('should load exact files', () => { const db = '__'; const sequelizeFolder = new Sequelize({ - operatorsAliases: Op, database: db, dialect: 'sqlite', username: 'root', @@ -309,7 +303,6 @@ describe('sequelize', () => { it('should load classes from folders and from glob', () => { const db = '__'; const sequelizeGlobFolder = new Sequelize({ - operatorsAliases: Op, database: db, dialect: 'sqlite', username: 'root', diff --git a/test/specs/repository-mode.spec.ts b/test/specs/repository-mode.spec.ts index 2b60bd59..5c546a67 100644 --- a/test/specs/repository-mode.spec.ts +++ b/test/specs/repository-mode.spec.ts @@ -1,5 +1,4 @@ import { expect } from 'chai'; -import { Op } from 'sequelize'; import { BelongsToMany } from '../../src/associations/belongs-to-many/belongs-to-many'; import { Table } from '../../src/model/table/table'; @@ -33,13 +32,11 @@ describe('repository-mode', () => { before(async () => { sequelizeA = new Sequelize({ - operatorsAliases: Op, ...defaultOptions, database: 'a', models: [User], }); sequelizeB = new Sequelize({ - operatorsAliases: Op, ...defaultOptions, database: 'b', models: [User], @@ -103,7 +100,6 @@ describe('repository-mode', () => { before(async () => { sequelize = new Sequelize({ - operatorsAliases: Op, ...defaultOptions, database: 'a', models: [User, Address], @@ -160,7 +156,6 @@ describe('repository-mode', () => { before(async () => { sequelizeA = new Sequelize({ - operatorsAliases: Op, ...defaultOptions, database: 'a', repositoryMode: true, @@ -168,7 +163,6 @@ describe('repository-mode', () => { models: [User, Comment], }); sequelizeB = new Sequelize({ - operatorsAliases: Op, ...defaultOptions, database: 'b', repositoryMode: true, @@ -241,7 +235,6 @@ describe('repository-mode', () => { before(async () => { sequelizeA = new Sequelize({ - operatorsAliases: Op, ...defaultOptions, database: 'a', repositoryMode: true, @@ -249,7 +242,6 @@ describe('repository-mode', () => { models: [User, Event, UserEvent], }); sequelizeB = new Sequelize({ - operatorsAliases: Op, ...defaultOptions, database: 'b', repositoryMode: true, diff --git a/test/specs/unique.spec.ts b/test/specs/unique.spec.ts index d4d9dfc7..da148b5a 100644 --- a/test/specs/unique.spec.ts +++ b/test/specs/unique.spec.ts @@ -1,5 +1,4 @@ import { getAttributes, Model, Sequelize } from '../../src'; -import { Op } from 'sequelize'; import { expect } from 'chai'; import { Table } from '../../src/model/table/table'; import { Column } from '../../src/model/column/column'; @@ -17,7 +16,6 @@ describe('unique decorator', () => { User = UserModel; new Sequelize({ - operatorsAliases: Op, dialect: 'sqlite', storage: ':memory:', logging: !('DISABLE_LOGGING' in process.env), diff --git a/test/utils/sequelize.ts b/test/utils/sequelize.ts index 4a6abc58..54bca0d7 100644 --- a/test/utils/sequelize.ts +++ b/test/utils/sequelize.ts @@ -17,7 +17,6 @@ export function createSequelize( } return new Sequelize({ - operatorsAliases: Op, database: '__', dialect: 'sqlite' as const, username: 'root', @@ -32,7 +31,6 @@ export function createSequelize( export function createSequelizeValidationOnly(useModelsInPath = true): Sequelize { return new Sequelize({ - operatorsAliases: Op, validateOnly: true, logging: !('DISABLE_LOGGING' in process.env), models: useModelsInPath ? [__dirname + '/../models'] : [], @@ -48,7 +46,6 @@ export function createSequelizeFromUri(useModelsInPath = true): Sequelize { export function createSequelizeFromUriObject(useModelsInPath = true): Sequelize { return new Sequelize('sqlite://', { - operatorsAliases: Op, modelPaths: useModelsInPath ? [__dirname + '/../models'] : [], }); }