Skip to content

Commit 0041fee

Browse files
Disables logging while running tests on ci
1 parent adf4040 commit 0041fee

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

.github/workflows/nodejs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ jobs:
3333
- run: 'npm install'
3434
- run: 'npm run lint'
3535
- run: 'npm run build'
36-
- run: 'npm run cover'
36+
- run: 'DISABLE_LOGGING=1 npm run cover'
3737
- run: 'npx nyc report --reporter=lcov > coverage.lcov && npx codecov'

test/specs/models/sequelize.spec.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ describe('sequelize', () => {
6161
username: 'root',
6262
password: '',
6363
storage: ':memory:',
64-
logging: !('SEQ_SILENT' in process.env),
64+
logging: !('DISABLE_LOGGING' in process.env),
6565
});
6666

6767
it('should equal Sequelize class', () => {
@@ -82,7 +82,7 @@ describe('sequelize', () => {
8282
const sequelizeUri = new Sequelize(connectionUri, {
8383
operatorsAliases: Op,
8484
storage: ':memory:',
85-
logging: !('SEQ_SILENT' in process.env),
85+
logging: !('DISABLE_LOGGING' in process.env),
8686
pool: {max: 8, min: 0},
8787
});
8888

@@ -266,7 +266,7 @@ describe('sequelize', () => {
266266
database: '__',
267267
dialect: 'sqlite',
268268
storage: ':memory:',
269-
logging: !('SEQ_SILENT' in process.env),
269+
logging: !('DISABLE_LOGGING' in process.env),
270270
models: [Test]
271271
});
272272

@@ -281,7 +281,7 @@ describe('sequelize', () => {
281281
database: '__',
282282
dialect: 'sqlite',
283283
storage: ':memory:',
284-
logging: !('SEQ_SILENT' in process.env),
284+
logging: !('DISABLE_LOGGING' in process.env),
285285
});
286286
sequelize1.addModels([Test]);
287287

@@ -299,7 +299,7 @@ describe('sequelize', () => {
299299
username: 'root',
300300
password: '',
301301
storage: ':memory:',
302-
logging: !('SEQ_SILENT' in process.env),
302+
logging: !('DISABLE_LOGGING' in process.env),
303303
models: [__dirname + '/../../models/globs/match-sub-dir-files/**/*.model.ts']
304304
});
305305

@@ -318,7 +318,7 @@ describe('sequelize', () => {
318318
username: 'root',
319319
password: '',
320320
storage: ':memory:',
321-
logging: !('SEQ_SILENT' in process.env),
321+
logging: !('DISABLE_LOGGING' in process.env),
322322
models: [__dirname + '/../../models/globs/match-dir-only']
323323
});
324324

@@ -337,7 +337,7 @@ describe('sequelize', () => {
337337
username: 'root',
338338
password: '',
339339
storage: ':memory:',
340-
logging: !('SEQ_SILENT' in process.env),
340+
logging: !('DISABLE_LOGGING' in process.env),
341341
models: ['AddressDir.ts', 'UserDir.ts'].map(file => join(__dirname, '/../../models/globs/match-files', file))
342342
});
343343

@@ -355,7 +355,7 @@ describe('sequelize', () => {
355355
username: 'root',
356356
password: '',
357357
storage: ':memory:',
358-
logging: !('SEQ_SILENT' in process.env),
358+
logging: !('DISABLE_LOGGING' in process.env),
359359
modelPaths: [__dirname + '/../../models/globs/match-dir-only', __dirname + '/../../models/globs/match-sub-dir-files/**/*.model.ts']
360360
});
361361

test/specs/repository-mode.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('repository-mode', () => {
1818
dialect: 'sqlite',
1919
username: 'root',
2020
password: '',
21-
logging: !!process.env.SEQ_SILENT,
21+
logging: !!process.env.DISABLE_LOGGING,
2222
repositoryMode: true,
2323
};
2424

@@ -168,15 +168,15 @@ describe('repository-mode', () => {
168168
...defaultOptions,
169169
database: 'a',
170170
repositoryMode: true,
171-
logging: !!process.env.SEQ_SILENT,
171+
logging: !!process.env.DISABLE_LOGGING,
172172
models: [User, Comment],
173173
});
174174
sequelizeB = new Sequelize({
175175
operatorsAliases: Op,
176176
...defaultOptions,
177177
database: 'b',
178178
repositoryMode: true,
179-
logging: !!process.env.SEQ_SILENT,
179+
logging: !!process.env.DISABLE_LOGGING,
180180
models: [User, Comment],
181181
});
182182
});
@@ -246,15 +246,15 @@ describe('repository-mode', () => {
246246
...defaultOptions,
247247
database: 'a',
248248
repositoryMode: true,
249-
logging: !!process.env.SEQ_SILENT,
249+
logging: !!process.env.DISABLE_LOGGING,
250250
models: [User, Event, UserEvent],
251251
});
252252
sequelizeB = new Sequelize({
253253
operatorsAliases: Op,
254254
...defaultOptions,
255255
database: 'b',
256256
repositoryMode: true,
257-
logging: !!process.env.SEQ_SILENT,
257+
logging: !!process.env.DISABLE_LOGGING,
258258
models: [User, Event, UserEvent],
259259
});
260260
});

test/specs/unique.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('unique decorator', () => {
2222
operatorsAliases: Op,
2323
dialect: 'sqlite',
2424
storage: ':memory:',
25-
logging: !('SEQ_SILENT' in process.env),
25+
logging: !('DISABLE_LOGGING' in process.env),
2626
models: [User],
2727
});
2828
});

test/utils/sequelize.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function createSequelize(useModelsInPathOrPartialOptions?: boolean | Part
2424
password: '',
2525
define,
2626
storage: ':memory:',
27-
logging: !('SEQ_SILENT' in process.env),
27+
logging: !('DISABLE_LOGGING' in process.env),
2828
modelPaths: useModelsInPath ? [__dirname + '/../models'] : [],
2929
...partialOptions,
3030
});
@@ -35,7 +35,7 @@ export function createSequelizeValidationOnly(useModelsInPath: boolean = true):
3535
return new Sequelize({
3636
operatorsAliases: Op,
3737
validateOnly: true,
38-
logging: !('SEQ_SILENT' in process.env),
38+
logging: !('DISABLE_LOGGING' in process.env),
3939
models: useModelsInPath ? [__dirname + '/../models'] : []
4040
});
4141
}

0 commit comments

Comments
 (0)