Skip to content

Commit dcd8b23

Browse files
authored
improvement: ♻️ fix the usage of the keyword new in tests (#410)
1 parent 35b0c57 commit dcd8b23

8 files changed

+79
-79
lines changed

test/tests/adapters/mongoose.test.js

Lines changed: 69 additions & 69 deletions
Large diffs are not rendered by default.

test/tests/services/filters-parser.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ describe('service > filters-parser', () => {
3737

3838
return mongooseConnect()
3939
.then(() => {
40-
const IslandSchema = mongoose.Schema({
40+
const IslandSchema = new mongoose.Schema({
4141
id: { type: Number },
4242
name: { type: String },
4343
size: { type: Number },

test/tests/services/query-builder.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ describe('service > query-builder', () => {
4747

4848
return mongooseConnect()
4949
.then(() => {
50-
const LumberJackSchema = mongoose.Schema({
50+
const LumberJackSchema = new mongoose.Schema({
5151
_id: { type: 'ObjectId' },
5252
name: { type: String },
5353
});
54-
const TreeSchema = mongoose.Schema({
54+
const TreeSchema = new mongoose.Schema({
5555
id: { type: Number },
5656
age: { type: String },
5757
owner: { type: 'ObjectId' },

test/tests/services/resource-remover.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('service > resource-remover', () => {
2424

2525
return mongooseConnect()
2626
.then(() => {
27-
const IslandSchema = mongoose.Schema({
27+
const IslandSchema = new mongoose.Schema({
2828
name: { type: String },
2929
});
3030

test/tests/services/resources-creator.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('service > resources-creator', () => {
2525

2626
return mongooseConnect()
2727
.then(() => {
28-
const IslandSchema = mongoose.Schema({
28+
const IslandSchema = new mongoose.Schema({
2929
name: {
3030
type: String,
3131
validate: {

test/tests/services/resources-getter.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,19 @@ describe('service > resources-getter', () => {
6262

6363
return mongooseConnect()
6464
.then(() => {
65-
const OrderSchema = mongoose.Schema({
65+
const OrderSchema = new mongoose.Schema({
6666
amount: { type: Number },
6767
comment: { type: String },
6868
giftMessage: { type: String },
6969
orderer: { type: 'ObjectId' },
7070
receiver: { type: 'ObjectId' },
7171
});
72-
const UserSchema = mongoose.Schema({
72+
const UserSchema = new mongoose.Schema({
7373
_id: { type: 'ObjectId' },
7474
name: { type: String },
7575
age: { type: Number },
7676
});
77-
const FilmSchema = mongoose.Schema({
77+
const FilmSchema = new mongoose.Schema({
7878
_id: { type: 'ObjectId' },
7979
title: { type: String },
8080
duration: { type: Number },

test/tests/services/resources-remover.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('service > resources-remover', () => {
2525

2626
return mongooseConnect()
2727
.then(() => {
28-
const IslandSchema = mongoose.Schema({
28+
const IslandSchema = new mongoose.Schema({
2929
name: { type: String },
3030
});
3131

test/tests/services/resources-updater.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('service > resources-updater', () => {
2525

2626
return mongooseConnect()
2727
.then(() => {
28-
const IslandSchema = mongoose.Schema({
28+
const IslandSchema = new mongoose.Schema({
2929
name: {
3030
type: String,
3131
validate: {

0 commit comments

Comments
 (0)