mirror of
https://github.com/Dahlgren/arma-server-web-admin.git
synced 2024-08-30 17:22:10 +00:00
32 lines
812 B
JavaScript
32 lines
812 B
JavaScript
var path = require('path')
|
|
require('should')
|
|
var tk = require('timekeeper')
|
|
|
|
var Logs = require('../../lib/logs.js')
|
|
var logs = new Logs({
|
|
path: '/tmp/',
|
|
type: 'linux'
|
|
})
|
|
|
|
describe('Logs', function () {
|
|
beforeEach(function () {
|
|
tk.freeze(1445455712000) // 2015-10-21 19:28:32
|
|
})
|
|
|
|
afterEach(function () {
|
|
tk.reset()
|
|
})
|
|
|
|
describe('generateLogFileName()', function () {
|
|
it('should generate valid file name', function () {
|
|
Logs.generateLogFileName('prefix', 'suffix').should.eql('prefix_2015-10-21_19-28-32_suffix.rpt')
|
|
})
|
|
})
|
|
|
|
describe('generateLogFilePath()', function () {
|
|
it('should generate valid file path', function () {
|
|
logs.generateLogFilePath('prefix', 'suffix').should.eql(path.join('/tmp', 'logs', 'prefix_2015-10-21_19-28-32_suffix.rpt'))
|
|
})
|
|
})
|
|
})
|