Skip to content
Snippets Groups Projects
Commit d2f9af3e authored by Sigmund, Dominik's avatar Sigmund, Dominik
Browse files

Update index.test.js, examples/all-options.js, examples/log-to-file.js,...

Update index.test.js, examples/all-options.js, examples/log-to-file.js, examples/no-options.js, package.json files
parent fde00092
No related branches found
No related tags found
1 merge request!1Update index.test.js, examples/all-options.js, examples/log-to-file.js,...
File moved
File moved
File moved
...@@ -19,7 +19,7 @@ let orginialFile ...@@ -19,7 +19,7 @@ let orginialFile
let log let log
let line let line
let testline let testline
describe('Log.js', () => { describe('@br/Log', () => {
describe(': No Options', () => { describe(': No Options', () => {
beforeEach(() => { beforeEach(() => {
console.log('create Object') console.log('create Object')
...@@ -43,21 +43,21 @@ describe('Log.js', () => { ...@@ -43,21 +43,21 @@ describe('Log.js', () => {
}) })
describe(': Warn', () => { describe(': Warn', () => {
it('should output the given Line', () => { it('should output the given Line', () => {
testline = getDate() + '\t' + hostname + '\tlib-log\tWARN\ttestline' testline = getDate() + '\t' + hostname + '\t@br/log\tWARN\ttestline'
line = log.warn('testline') line = log.warn('testline')
assert.equal(line, testline) assert.equal(line, testline)
}) })
}) })
describe(': Error', () => { describe(': Error', () => {
it('should output the given Line', () => { it('should output the given Line', () => {
testline = getDate() + '\t' + hostname + '\tlib-log\tERROR\ttestline' testline = getDate() + '\t' + hostname + '\t@br/log\tERROR\ttestline'
line = log.error('testline') line = log.error('testline')
assert.equal(line, testline) assert.equal(line, testline)
}) })
}) })
describe(': Fatal', () => { describe(': Fatal', () => {
it('should output the given Line', () => { it('should output the given Line', () => {
testline = getDate() + '\t' + hostname + '\tlib-log\tFATAL\ttestline' testline = getDate() + '\t' + hostname + '\t@br/log\tFATAL\ttestline'
line = log.fatal('testline') line = log.fatal('testline')
assert.equal(line, testline) assert.equal(line, testline)
}) })
...@@ -94,21 +94,21 @@ describe('Log.js', () => { ...@@ -94,21 +94,21 @@ describe('Log.js', () => {
}) })
describe(': Warn', () => { describe(': Warn', () => {
it('should output the given Line', () => { it('should output the given Line', () => {
testline = getDate() + '\t' + manualhostname + '\tlib-log\tWARN\ttestline' testline = getDate() + '\t' + manualhostname + '\t@br/log\tWARN\ttestline'
line = log.warn('testline') line = log.warn('testline')
assert.equal(line, testline) assert.equal(line, testline)
}) })
}) })
describe(': Error', () => { describe(': Error', () => {
it('should output the given Line', () => { it('should output the given Line', () => {
testline = getDate() + '\t' + manualhostname + '\tlib-log\tERROR\ttestline' testline = getDate() + '\t' + manualhostname + '\t@br/log\tERROR\ttestline'
line = log.error('testline') line = log.error('testline')
assert.equal(line, testline) assert.equal(line, testline)
}) })
}) })
describe(': Fatal', () => { describe(': Fatal', () => {
it('should output the given Line', () => { it('should output the given Line', () => {
testline = getDate() + '\t' + manualhostname + '\tlib-log\tFATAL\ttestline' testline = getDate() + '\t' + manualhostname + '\t@br/log\tFATAL\ttestline'
line = log.fatal('testline') line = log.fatal('testline')
assert.equal(line, testline) assert.equal(line, testline)
}) })
...@@ -214,7 +214,7 @@ describe('Log.js', () => { ...@@ -214,7 +214,7 @@ describe('Log.js', () => {
}) })
describe(': Warn', () => { describe(': Warn', () => {
it('should output the given Line to the file', function (done) { it('should output the given Line to the file', function (done) {
testline = getDate() + '\t' + hostname + '\tlib-log\tWARN\ttestline\n' testline = getDate() + '\t' + hostname + '\t@br/log\tWARN\ttestline\n'
log.warn('testline') log.warn('testline')
setTimeout(() => { setTimeout(() => {
line = fs.readFileSync(file, 'utf-8') line = fs.readFileSync(file, 'utf-8')
...@@ -225,7 +225,7 @@ describe('Log.js', () => { ...@@ -225,7 +225,7 @@ describe('Log.js', () => {
}) })
describe(': Error', () => { describe(': Error', () => {
it('should output the given Line to the file', function (done) { it('should output the given Line to the file', function (done) {
testline = getDate() + '\t' + hostname + '\tlib-log\tERROR\ttestline\n' testline = getDate() + '\t' + hostname + '\t@br/log\tERROR\ttestline\n'
log.error('testline') log.error('testline')
setTimeout(() => { setTimeout(() => {
line = fs.readFileSync(file, 'utf-8') line = fs.readFileSync(file, 'utf-8')
...@@ -236,7 +236,7 @@ describe('Log.js', () => { ...@@ -236,7 +236,7 @@ describe('Log.js', () => {
}) })
describe(': Fatal', () => { describe(': Fatal', () => {
it('should output the given Line to the file', function (done) { it('should output the given Line to the file', function (done) {
testline = getDate() + '\t' + hostname + '\tlib-log\tFATAL\ttestline\n' testline = getDate() + '\t' + hostname + '\t@br/log\tFATAL\ttestline\n'
log.fatal('testline') log.fatal('testline')
setTimeout(() => { setTimeout(() => {
line = fs.readFileSync(file, 'utf-8') line = fs.readFileSync(file, 'utf-8')
...@@ -269,42 +269,42 @@ describe('Log.js', () => { ...@@ -269,42 +269,42 @@ describe('Log.js', () => {
}) })
describe(': Info', () => { describe(': Info', () => {
it('should output the given Line', () => { it('should output the given Line', () => {
testline = getDate() + '\t' + hostname + '\tlib-log\tINFO\ttestline' testline = getDate() + '\t' + hostname + '\t@br/log\tINFO\ttestline'
line = log.info('testline') line = log.info('testline')
assert.equal(line, testline) assert.equal(line, testline)
}) })
}) })
describe(': Notice', () => { describe(': Notice', () => {
it('should output the given Line', () => { it('should output the given Line', () => {
testline = getDate() + '\t' + hostname + '\tlib-log\tNOTICE\ttestline' testline = getDate() + '\t' + hostname + '\t@br/log\tNOTICE\ttestline'
line = log.notice('testline') line = log.notice('testline')
assert.equal(line, testline) assert.equal(line, testline)
}) })
}) })
describe(': Warn', () => { describe(': Warn', () => {
it('should output the given Line', () => { it('should output the given Line', () => {
testline = getDate() + '\t' + hostname + '\tlib-log\tWARN\ttestline' testline = getDate() + '\t' + hostname + '\t@br/log\tWARN\ttestline'
line = log.warn('testline') line = log.warn('testline')
assert.equal(line, testline) assert.equal(line, testline)
}) })
}) })
describe(': Error', () => { describe(': Error', () => {
it('should output the given Line', () => { it('should output the given Line', () => {
testline = getDate() + '\t' + hostname + '\tlib-log\tERROR\ttestline' testline = getDate() + '\t' + hostname + '\t@br/log\tERROR\ttestline'
line = log.error('testline') line = log.error('testline')
assert.equal(line, testline) assert.equal(line, testline)
}) })
}) })
describe(': Fatal', () => { describe(': Fatal', () => {
it('should output the given Line', () => { it('should output the given Line', () => {
testline = getDate() + '\t' + hostname + '\tlib-log\tFATAL\ttestline' testline = getDate() + '\t' + hostname + '\t@br/log\tFATAL\ttestline'
line = log.fatal('testline') line = log.fatal('testline')
assert.equal(line, testline) assert.equal(line, testline)
}) })
}) })
describe(': Debug', () => { describe(': Debug', () => {
it('should output the given Line', () => { it('should output the given Line', () => {
testline = getDate() + '\t' + hostname + '\tlib-log\tDEBUG\ttestline' testline = getDate() + '\t' + hostname + '\t@br/log\tDEBUG\ttestline'
line = log.debug('testline') line = log.debug('testline')
assert.equal(line, testline) assert.equal(line, testline)
}) })
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"description": "A simple Logger with Options!", "description": "A simple Logger with Options!",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "jest tests/index.test.js", "test": "jest",
"sonarqube": "sonar-scanner -Dsonar.projectKey=argos-log -Dsonar.sources=. -Dsonar.host.url=https://it-devops-01.br-edv.brnet.int:8999 -Dsonar.login=gitlab" "sonarqube": "sonar-scanner -Dsonar.projectKey=argos-log -Dsonar.sources=. -Dsonar.host.url=https://it-devops-01.br-edv.brnet.int:8999 -Dsonar.login=gitlab"
}, },
"author": "Dominik Sigmund <sigmund.dominik@googlemail.com> (https://webdad.eu)", "author": "Dominik Sigmund <sigmund.dominik@googlemail.com> (https://webdad.eu)",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment