Skip to content

Commit

Permalink
Merge pull request #1297 from log4js-node/update-test
Browse files Browse the repository at this point in the history
test: support older Node.js versions
  • Loading branch information
lamweili committed Jul 25, 2022
2 parents dc3f7c3 + 798feb3 commit 35e2c6a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/tap/fileAppender-test.js
Expand Up @@ -40,7 +40,7 @@ test('log4js fileAppender', (batch) => {

logger.info('This should be in the file.');

await sleep(100);
await sleep(250);
const fileContents = await fs.readFile(testFile, 'utf8');
t.match(fileContents, `This should be in the file.${EOL}`);
t.match(
Expand Down Expand Up @@ -219,7 +219,7 @@ test('log4js fileAppender', (batch) => {
logger.info('This is the second log message.');

// wait for the file system to catch up
await sleep(100);
await sleep(250);
const fileContents = await fs.readFile(testFile, 'utf8');
t.match(fileContents, 'This is the second log message.');
t.notMatch(fileContents, 'These are the log messages for the first file.');
Expand Down Expand Up @@ -272,7 +272,7 @@ test('log4js fileAppender', (batch) => {
logger.info('This is the third log message.');
logger.info('This is the fourth log message.');
// give the system a chance to open the stream
await sleep(200);
await sleep(250);
const files = await fs.readdir(__dirname);
const logFiles = files
.sort()
Expand Down Expand Up @@ -334,7 +334,7 @@ test('log4js fileAppender', (batch) => {
logger.info('This is the third log message.');
logger.info('This is the fourth log message.');
// give the system a chance to open the stream
await sleep(1000);
await sleep(250);
const files = await fs.readdir(__dirname);
const logFiles = files
.sort()
Expand Down Expand Up @@ -503,7 +503,7 @@ test('log4js fileAppender', (batch) => {
[]
);

await sleep(100);
await sleep(250);
let fileContents = await fs.readFile(testFilePlain, 'utf8');
t.match(
fileContents,
Expand Down

0 comments on commit 35e2c6a

Please sign in to comment.