Skip to content

Commit

Permalink
test(tests): set the log level in tests according to process.env.LOG_…
Browse files Browse the repository at this point in the history
…LEVEL

Use process.env.LOG_LEVEL to set the logLevel in test files because the process.env.NODE_ENV value
will be not valid most of the time
  • Loading branch information
GiladShoham committed Oct 11, 2017
1 parent eafc037 commit ee8a5a8
Show file tree
Hide file tree
Showing 26 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion test/node/mocha-tests/328-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const Readable = require('stream').Readable
const SearchIndex = require('../../../')
const logLevel = process.env.NODE_ENV || 'error'
const logLevel = process.env.LOG_LEVEL || 'error'
const sandboxPath = 'test/sandbox'
const should = require('should')

Expand Down
2 changes: 1 addition & 1 deletion test/node/mocha-tests/boost-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const JSONStream = require('JSONStream')
const Readable = require('stream').Readable
const SearchIndex = require('../../../')
const logLevel = process.env.NODE_ENV || 'error'
const logLevel = process.env.LOG_LEVEL || 'error'
const sandboxPath = 'test/sandbox'
const should = require('should')
const sw = require('stopword')
Expand Down
2 changes: 1 addition & 1 deletion test/node/mocha-tests/callbackyAdd-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* global it */

const SearchIndex = require('../../../')
const logLevel = process.env.NODE_ENV || 'error'
const logLevel = process.env.LOG_LEVEL || 'error'
const should = require('should')

describe('Callbacky Add', function () {
Expand Down
2 changes: 1 addition & 1 deletion test/node/mocha-tests/configuration-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* global describe */

const fs = require('fs')
const logLevel = process.env.NODE_ENV || 'error'
const logLevel = process.env.LOG_LEVEL || 'error'
const sandboxPath = 'test/sandbox'
const searchindex = require('../../../')
const should = require('should')
Expand Down
2 changes: 1 addition & 1 deletion test/node/mocha-tests/delete-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

const JSONStream = require('JSONStream')
const Readable = require('stream').Readable
const logLevel = process.env.NODE_ENV || 'error'
const logLevel = process.env.LOG_LEVEL || 'error'
const sandboxPath = 'test/sandbox'
const searchIndex = require('../../../')
const should = require('should')
Expand Down
2 changes: 1 addition & 1 deletion test/node/mocha-tests/facet-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const JSONStream = require('JSONStream')
const Readable = require('stream').Readable
const SearchIndex = require('../../../')
const logLevel = process.env.NODE_ENV || 'error'
const logLevel = process.env.LOG_LEVEL || 'error'
const sandboxPath = 'test/sandbox'
const should = require('should')

Expand Down
2 changes: 1 addition & 1 deletion test/node/mocha-tests/fieldsToStore-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const JSONStream = require('JSONStream')
const Readable = require('stream').Readable
const SearchIndex = require('../../../')
const logLevel = process.env.NODE_ENV || 'error'
const logLevel = process.env.LOG_LEVEL || 'error'
const sandboxPath = 'test/sandbox'
const should = require('should')

Expand Down
2 changes: 1 addition & 1 deletion test/node/mocha-tests/flush-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const JSONStream = require('JSONStream')
const Readable = require('stream').Readable
const SearchIndex = require('../../../')
const logLevel = process.env.NODE_ENV || 'error'
const logLevel = process.env.LOG_LEVEL || 'error'
const sandboxPath = 'test/sandbox'
const should = require('should')
const sw = require('stopword')
Expand Down
2 changes: 1 addition & 1 deletion test/node/mocha-tests/get-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

const JSONStream = require('JSONStream')
const Readable = require('stream').Readable
const logLevel = process.env.NODE_ENV || 'error'
const logLevel = process.env.LOG_LEVEL || 'error'
const sandboxPath = 'test/sandbox'
const searchIndex = require('../../../')
const should = require('should')
Expand Down
2 changes: 1 addition & 1 deletion test/node/mocha-tests/indexing-test-2.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* global describe */

const Readable = require('stream').Readable
const logLevel = process.env.NODE_ENV || 'error'
const logLevel = process.env.LOG_LEVEL || 'error'
const s = new Readable({ objectMode: true })
const sandboxPath = 'test/sandbox'
const should = require('should')
Expand Down
2 changes: 1 addition & 1 deletion test/node/mocha-tests/indexing-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

const JSONStream = require('JSONStream')
const Readable = require('stream').Readable
const logLevel = process.env.NODE_ENV || 'error'
const logLevel = process.env.LOG_LEVEL || 'error'
const sandboxPath = 'test/sandbox'
const should = require('should')

Expand Down
2 changes: 1 addition & 1 deletion test/node/mocha-tests/instantiation-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

const JSONStream = require('JSONStream')
const Readable = require('stream').Readable
const logLevel = process.env.NODE_ENV || 'error'
const logLevel = process.env.LOG_LEVEL || 'error'
const sandboxPath = 'test/sandbox'
const searchindex = require('../../../')
const should = require('should')
Expand Down
2 changes: 1 addition & 1 deletion test/node/mocha-tests/matching-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

const Readable = require('stream').Readable
const SearchIndex = require('../../../')
const logLevel = process.env.NODE_ENV || 'error'
const logLevel = process.env.LOG_LEVEL || 'error'
const should = require('should')

var s = new Readable({ objectMode: true })
Expand Down
2 changes: 1 addition & 1 deletion test/node/mocha-tests/non-ascii-char-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

const Readable = require('stream').Readable
const SearchIndex = require('../../../')
const logLevel = process.env.NODE_ENV || 'error'
const logLevel = process.env.LOG_LEVEL || 'error'
const s = new Readable({ objectMode: true })
const sandboxPath = 'test/sandbox'
const should = require('should')
Expand Down
2 changes: 1 addition & 1 deletion test/node/mocha-tests/or-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* global it */

const SearchIndex = require('../../../')
const logLevel = process.env.NODE_ENV || 'error'
const logLevel = process.env.LOG_LEVEL || 'error'
const s = require('stream').Readable({ objectMode: true})
const sandboxPath = 'test/sandbox'
const should = require('should')
Expand Down
2 changes: 1 addition & 1 deletion test/node/mocha-tests/phrase-search-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

const Readable = require('stream').Readable
const SearchIndex = require('../../../')
const logLevel = process.env.NODE_ENV || 'error'
const logLevel = process.env.LOG_LEVEL || 'error'
const sandboxPath = 'test/sandbox'
const should = require('should')
const stopwords = require('stopword').en
Expand Down
2 changes: 1 addition & 1 deletion test/node/mocha-tests/preserve-case-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

const JSONStream = require('JSONStream')
const Readable = require('stream').Readable
const logLevel = process.env.NODE_ENV || 'error'
const logLevel = process.env.LOG_LEVEL || 'error'
const sandboxPath = 'test/sandbox'
const searchIndex = require('../../../')
const should = require('should')
Expand Down
2 changes: 1 addition & 1 deletion test/node/mocha-tests/providing-levelup-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

const Readable = require('stream').Readable
const levelup = require('levelup')
const logLevel = process.env.NODE_ENV || 'error'
const logLevel = process.env.LOG_LEVEL || 'error'
const sandbox = 'test/sandbox'
const searchIndex = require('../../../')
const should = require('should')
Expand Down
2 changes: 1 addition & 1 deletion test/node/mocha-tests/relevancy-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

const Readable = require('stream').Readable
const SearchIndex = require('../../../')
const logLevel = process.env.NODE_ENV || 'error'
const logLevel = process.env.LOG_LEVEL || 'error'
const s = new Readable({ objectMode: true })
const sandboxPath = 'test/sandbox'
const should = require('should')
Expand Down
2 changes: 1 addition & 1 deletion test/node/mocha-tests/scan-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const JSONStream = require('JSONStream')
const Readable = require('stream').Readable
const SearchIndex = require('../../../')
const logLevel = process.env.NODE_ENV || 'error'
const logLevel = process.env.LOG_LEVEL || 'error'
const sandbox = process.env.SANDBOX || 'test/sandbox'
const should = require('should')

Expand Down
2 changes: 1 addition & 1 deletion test/node/mocha-tests/search-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const JSONStream = require('JSONStream')
const SearchIndex = require('../../../')
const fs = require('fs')
const logLevel = process.env.NODE_ENV || 'error'
const logLevel = process.env.LOG_LEVEL || 'error'
const mocha = require('mocha')
const request = require('request')
const sandbox = './test/sandbox/'
Expand Down
2 changes: 1 addition & 1 deletion test/node/mocha-tests/sorting-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

const Readable = require('stream').Readable
const SearchIndex = require('../../../')
const logLevel = process.env.NODE_ENV || 'error'
const logLevel = process.env.LOG_LEVEL || 'error'
const sandboxPath = 'test/sandbox'
const should = require('should')
const sw = require('stopword')
Expand Down
2 changes: 1 addition & 1 deletion test/node/mocha-tests/sqlite-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const Readable = require('stream').Readable
const SearchIndex = require('../../../')
const levelup = require('levelup')
const logLevel = process.env.NODE_ENV || 'error'
const logLevel = process.env.LOG_LEVEL || 'error'
const sandbox = 'test/sandbox'
const should = require('should')
const sqldown = require('sqldown')
Expand Down
2 changes: 1 addition & 1 deletion test/node/mocha-tests/stopword-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* global describe */

const Readable = require('stream').Readable
const logLevel = process.env.NODE_ENV || 'error'
const logLevel = process.env.LOG_LEVEL || 'error'
const sandboxPath = 'test/sandbox'
const searchindex = require('../../../')
const should = require('should')
Expand Down
2 changes: 1 addition & 1 deletion test/node/mocha-tests/stream-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const JSONStream = require('JSONStream')
const SearchIndex = require('../../../')
const fs = require('fs')
const logLevel = process.env.NODE_ENV || 'error'
const logLevel = process.env.LOG_LEVEL || 'error'
const should = require('should')

var si
Expand Down
2 changes: 1 addition & 1 deletion test/node/tape-tests/classifier-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const Readable = require('stream').Readable
const SearchIndex = require('../../../')
const logLevel = process.env.NODE_ENV || 'warn'
const logLevel = process.env.LOG_LEVEL || 'warn'
const sandbox = process.env.SANDBOX || 'test/sandbox'
const test = require('tape')

Expand Down

0 comments on commit ee8a5a8

Please sign in to comment.