Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing a few more node v0.8 issues.

  • Loading branch information...
commit a8fc09b31fb92f5b3f6ec6db425ed3e548a931e1 1 parent a373cfd
André Rodrigues andrerod authored
7 test/runjshint.js
View
@@ -14,7 +14,6 @@
*/
var fs = require('fs');
-var path = require('path');
var walk = function (dir, done) {
var results = [];
@@ -42,8 +41,12 @@ var walk = function (dir, done) {
var jshint = require('../node_modules/jshint/packages/jshint/jshint');
+if (!fs.existsSync) {
+ fs.existsSync = require('path').existsSync;
+}
+
var libDir = '../lib';
-if (!path.existsSync(libDir + '/azure.js')) {
+if (!fs.existsSync(libDir + '/azure.js')) {
libDir = './lib';
}
8 test/runtests.js
View
@@ -14,7 +14,6 @@
*/
var fs = require('fs');
-var path = require('path');
var args = (process.ARGV || process.argv);
@@ -28,7 +27,12 @@ var testList = args.pop();
var fileContent;
var root = false;
-if (path.existsSync(testList)) {
+
+if (!fs.existsSync) {
+ fs.existsSync = require('path').existsSync;
+}
+
+if (fs.existsSync(testList)) {
fileContent = fs.readFileSync(testList).toString();
} else {
fileContent = fs.readFileSync('./test/' + testList).toString();
14 test/serviceruntime/roleenvironment-tests.js
View
@@ -82,6 +82,12 @@ function setupGoalStateEndpoint () {
suite('roleenvironment-tests', function () {
setup(function (done) {
+ // Temporary fix for node version < 0.8, starting from v0.8
+ // path.existsSync has been deprecated.
+ if (!fs.existsSync) {
+ fs.existsSync = path.existsSync;
+ }
+
// Set windows azure runtime endpoint
originalWaRuntimeEndpoint = process.env['WaRuntimeEndpoint'];
process.env['WaRuntimeEndpoint'] = versionsEndpointPath;
@@ -105,19 +111,19 @@ suite('roleenvironment-tests', function () {
runtimeKernel.protocol1RuntimeGoalStateClient.currentEnvironmentData = null;
runtimeKernel.protocol1RuntimeGoalStateClient.currentGoalState = null;
- if (path.existsSync(versionsEndpointPath)) {
+ if (fs.existsSync(versionsEndpointPath)) {
fs.unlinkSync(versionsEndpointPath);
}
- if (path.existsSync(goalStatePath)) {
+ if (fs.existsSync(goalStatePath)) {
fs.unlinkSync(goalStatePath);
}
- if (path.existsSync(currentStatePath)) {
+ if (fs.existsSync(currentStatePath)) {
fs.unlinkSync(currentStatePath);
}
- if (path.existsSync(roleEnvironmentPath)) {
+ if (fs.existsSync(roleEnvironmentPath)) {
fs.unlinkSync(roleEnvironmentPath);
}
Please sign in to comment.
Something went wrong with that request. Please try again.