Skip to content

Commit

Permalink
test: [test/specs/instance.spec.ts] - Model.reload() method is return…
Browse files Browse the repository at this point in the history
… Model,

Deprecated: Operator Aliases
  • Loading branch information
mystylelee2 committed Feb 11, 2022
1 parent 3742e0d commit 61507a8
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 21 deletions.
2 changes: 1 addition & 1 deletion test/specs/instance.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
})
Expand Down
7 changes: 0 additions & 7 deletions test/specs/models/sequelize.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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',
Expand All @@ -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 },
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand Down
8 changes: 0 additions & 8 deletions test/specs/repository-mode.spec.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -103,7 +100,6 @@ describe('repository-mode', () => {

before(async () => {
sequelize = new Sequelize({
operatorsAliases: Op,
...defaultOptions,
database: 'a',
models: [User, Address],
Expand Down Expand Up @@ -160,15 +156,13 @@ describe('repository-mode', () => {

before(async () => {
sequelizeA = new Sequelize({
operatorsAliases: Op,
...defaultOptions,
database: 'a',
repositoryMode: true,
logging: !!process.env.DISABLE_LOGGING,
models: [User, Comment],
});
sequelizeB = new Sequelize({
operatorsAliases: Op,
...defaultOptions,
database: 'b',
repositoryMode: true,
Expand Down Expand Up @@ -241,15 +235,13 @@ describe('repository-mode', () => {

before(async () => {
sequelizeA = new Sequelize({
operatorsAliases: Op,
...defaultOptions,
database: 'a',
repositoryMode: true,
logging: !!process.env.DISABLE_LOGGING,
models: [User, Event, UserEvent],
});
sequelizeB = new Sequelize({
operatorsAliases: Op,
...defaultOptions,
database: 'b',
repositoryMode: true,
Expand Down
2 changes: 0 additions & 2 deletions test/specs/unique.spec.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -17,7 +16,6 @@ describe('unique decorator', () => {
User = UserModel;

new Sequelize({
operatorsAliases: Op,
dialect: 'sqlite',
storage: ':memory:',
logging: !('DISABLE_LOGGING' in process.env),
Expand Down
3 changes: 0 additions & 3 deletions test/utils/sequelize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export function createSequelize(
}

return new Sequelize({
operatorsAliases: Op,
database: '__',
dialect: 'sqlite' as const,
username: 'root',
Expand All @@ -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'] : [],
Expand All @@ -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'] : [],
});
}

0 comments on commit 61507a8

Please sign in to comment.