Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

winston-daily-rotate-file

Package Overview
Dependencies
Maintainers
2
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

winston-daily-rotate-file - npm Package Compare versions

Comparing version 1.7.0 to 1.7.1

test.js

6

index.js

@@ -294,3 +294,3 @@ 'use strict';

// TODO when maxfilesize rotate occurs
var createdFiles = self._currentFiles; // _currentFiles array is already sorted chronologically
var createdFiles = self._currentFiles.slice(0); // Clone already sorted _currentFiles array
var results = [];

@@ -300,2 +300,6 @@ var row = 0;

if (createdFiles.length === 0 && callback) {
callback(null, results);
}
// Edit so that all created files are read:

@@ -302,0 +306,0 @@ (function readNextFile(nextFile) {

2

package.json
{
"name": "winston-daily-rotate-file",
"version": "1.7.0",
"version": "1.7.1",
"description": "A transport for winston which logs to a rotating file each day.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -328,4 +328,5 @@ /* eslint-disable max-nested-callbacks,no-unused-expressions */

afterEach(function () {
afterEach(function (done) {
tk.reset();
done();
});

@@ -404,4 +405,5 @@

afterEach(function () {
afterEach(function (done) {
tk.reset();
done();
});

@@ -757,3 +759,9 @@

}
transport.log('error', 'test message', {}, function (err) {
var filesCreated = fs.readdirSync(rotationLogPath);
expect(filesCreated.length).to.eql(1);
expect(filesCreated).to.include(pattern.oldfile);
self.time = new Date(pattern.mid);
tk.travel(self.time);
transport.log('error', '2nd test message', {}, function (err) {
if (err) {

@@ -763,43 +771,22 @@ done(err);

var filesCreated = fs.readdirSync(rotationLogPath);
expect(filesCreated.length).to.eql(1);
expect(filesCreated).to.include(pattern.oldfile);
self.time = new Date(pattern.mid);
filesCreated = fs.readdirSync(rotationLogPath);
expect(filesCreated.length).to.eql(2);
expect(filesCreated).to.include(pattern.oldfile + '.gz');
expect(filesCreated).to.include(pattern.midfile);
self.time = new Date(pattern.end);
tk.travel(self.time);
transport.log('error', '2nd test message', {}, function (err) {
transport.log('error', '3rd test message', {}, function (err) {
if (err) {
done(err);
}
transport.log('error', 'test message', {}, function (err) {
if (err) {
done(err);
}
filesCreated = fs.readdirSync(rotationLogPath);
expect(filesCreated.length).to.eql(2);
expect(filesCreated).to.include(pattern.oldfile + '.gz');
expect(filesCreated).to.include(pattern.midfile);
self.time = new Date(pattern.end);
tk.travel(self.time);
transport.log('error', '3rd test message', {}, function (err) {
if (err) {
done(err);
}
transport.log('error', 'test message', {}, function (err) {
if (err) {
done(err);
}
filesCreated = fs.readdirSync(rotationLogPath);
expect(filesCreated.length).to.eql(3);
expect(filesCreated).to.not.include(pattern.newfile + '.1');
expect(filesCreated).to.include(pattern.newfile);
expect(filesCreated).to.include(pattern.midfile + '.gz');
expect(filesCreated).to.include(pattern.oldfile + '.gz');
transport.close();
filesCreated = fs.readdirSync(rotationLogPath);
expect(filesCreated.length).to.eql(3);
expect(filesCreated).to.not.include(pattern.newfile + '.1');
expect(filesCreated).to.include(pattern.newfile);
expect(filesCreated).to.include(pattern.midfile + '.gz');
expect(filesCreated).to.include(pattern.oldfile + '.gz');
transport.close();
done();
});
});
});
done();
});

@@ -806,0 +793,0 @@ });

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc