nodeunit/nodeunit-0.9.1-Use-fs-stat.patch

29 lines
811 B
Diff
Raw Normal View History

2020-08-28 15:50:09 +08:00
commit a796685799f368964d76c788e6d41ca7dc59c295
Author: Tom Hughes <tom@compton.nu>
Date: Wed Jan 20 18:12:26 2016 +0000
Replace path.exists with fs.stat
diff --git a/test/test-runfiles.js b/test/test-runfiles.js
index ecbdfd8..2c276de 100644
--- a/test/test-runfiles.js
+++ b/test/test-runfiles.js
@@ -1,6 +1,5 @@
var assert = require('assert'),
fs = require('fs'),
- path = require('path'),
nodeunit = require('../lib/nodeunit');
@@ -116,8 +115,8 @@ exports.testEmptyDir = function (test) {
var dir2 = __dirname + '/fixtures/dir2';
// git doesn't like empty directories, so we have to create one
- path.exists(dir2, function (exists) {
- if (!exists) {
+ fs.stat(dir2, function (err) {
+ if (err) {
fs.mkdirSync(dir2, 0777);
}