Fixup all the tests

This commit is contained in:
Nick O'Leary
2018-08-20 16:17:24 +01:00
parent 998bf92ad4
commit 38a1291c5b
113 changed files with 458 additions and 250 deletions

View File

@@ -16,7 +16,10 @@
var when = require("when");
var should = require("should");
var paff = require('path');
var storage = require("../../../../red/runtime/storage/index");
var NR_TEST_UTILS = require("nr-test-utils");
var storage = NR_TEST_UTILS.require("@node-red/runtime/lib/storage/index");
describe("red/storage/index", function() {

View File

@@ -18,9 +18,10 @@ var should = require("should");
var fs = require('fs-extra');
var path = require('path');
var sinon = require('sinon');
var NR_TEST_UTILS = require("nr-test-utils");
var localfilesystem = require("../../../../../red/runtime/storage/localfilesystem");
var log = require("../../../../../red/util/log");
var localfilesystem = NR_TEST_UTILS.require("@node-red/runtime/lib/storage/localfilesystem");
var log = NR_TEST_UTILS.require("@node-red/util").log;
describe('storage/localfilesystem', function() {
var mockRuntime = {

View File

@@ -17,8 +17,9 @@
var should = require("should");
var fs = require('fs-extra');
var path = require('path');
var NR_TEST_UTILS = require("nr-test-utils");
var localfilesystemLibrary = require("../../../../../red/runtime/storage/localfilesystem/library");
var localfilesystemLibrary = NR_TEST_UTILS.require("@node-red/runtime/lib/storage/localfilesystem/library");
describe('storage/localfilesystem/library', function() {
var userDir = path.join(__dirname,".testUserHome");

View File

@@ -14,6 +14,8 @@
* limitations under the License.
**/
var NR_TEST_UTILS = require("nr-test-utils");
describe("storage/localfilesystem/projects/Project", function() {
it.skip("NEEDS TESTS WRITING",function() {});
})

View File

@@ -16,7 +16,8 @@
var should = require("should");
var defaultFileSet = require("../../../../../../red/runtime/storage/localfilesystem/projects/defaultFileSet");
var NR_TEST_UTILS = require("nr-test-utils");
var defaultFileSet = NR_TEST_UTILS.require("@node-red/runtime/lib/storage/localfilesystem/projects/defaultFileSet");
describe('storage/localfilesystem/projects/defaultFileSet', function() {
var runtime = {

View File

@@ -17,7 +17,8 @@
var should = require("should");
var sinon = require("sinon");
var authCache = require("../../../../../../../red/runtime/storage/localfilesystem/projects/git/authCache")
var NR_TEST_UTILS = require("nr-test-utils");
var authCache = NR_TEST_UTILS.require("@node-red/runtime/lib/storage/localfilesystem/projects/git/authCache")
describe("localfilesystem/projects/git/authCache", function() {

View File

@@ -22,7 +22,9 @@ var sinon = require("sinon");
var child_process = require("child_process");
var fs = require("fs-extra");
var authServer = require("../../../../../../../red/runtime/storage/localfilesystem/projects/git/authServer");
var NR_TEST_UTILS = require("nr-test-utils");
var authServer = NR_TEST_UTILS.require("@node-red/runtime/lib/storage/localfilesystem/projects/git/authServer");
var sendPrompt = function(localPath, prompt) {

View File

@@ -22,7 +22,9 @@ var sinon = require("sinon");
var child_process = require("child_process");
var fs = require("fs-extra");
var authWriter = "../../../../../../../red/runtime/storage/localfilesystem/projects/git/authWriter";
var NR_TEST_UTILS = require("nr-test-utils");
var authWriter = NR_TEST_UTILS.resolve("@node-red/runtime/lib/storage/localfilesystem/projects/git/authWriter");
function getListenPath() {
var seed = (0x100000+Math.random()*0x999999).toString(16);

View File

@@ -14,6 +14,8 @@
* limitations under the License.
**/
var NR_TEST_UTILS = require("nr-test-utils");
describe("storage/localfilesystem/projects/git/index", function() {
it.skip("NEEDS TESTS WRITING",function() {});
})

View File

@@ -14,6 +14,8 @@
* limitations under the License.
**/
var NR_TEST_UTILS = require("nr-test-utils");
describe("storage/localfilesystem/projects/index", function() {
it.skip("NEEDS TESTS WRITING",function() {});
})

View File

@@ -17,7 +17,8 @@ var should = require("should");
var fs = require('fs-extra');
var path = require('path');
var sshkeys = require("../../../../../../../red/runtime/storage/localfilesystem/projects/ssh");
var NR_TEST_UTILS = require("nr-test-utils");
var sshkeys = NR_TEST_UTILS.require("@node-red/runtime/lib/storage/localfilesystem/projects/ssh");
describe("storage/localfilesystem/projects/ssh", function() {
var userDir = path.join(__dirname,".testSSHKeyUserHome");

View File

@@ -19,7 +19,8 @@ var sinon = require("sinon");
var child_process = require('child_process');
var EventEmitter = require("events");
var keygen = require("../../../../../../../red/runtime/storage/localfilesystem/projects/ssh/keygen")
var NR_TEST_UTILS = require("nr-test-utils");
var keygen = NR_TEST_UTILS.require("@node-red/runtime/lib/storage/localfilesystem/projects/ssh/keygen")
describe("localfilesystem/projects/ssh/keygen", function() {

View File

@@ -18,7 +18,8 @@ var should = require("should");
var fs = require('fs-extra');
var path = require('path');
var localfilesystemSessions = require("../../../../../red/runtime/storage/localfilesystem/sessions");
var NR_TEST_UTILS = require("nr-test-utils");
var localfilesystemSessions = NR_TEST_UTILS.require("@node-red/runtime/lib/storage/localfilesystem/sessions");
describe('storage/localfilesystem/sessions', function() {
var userDir = path.join(__dirname,".testUserHome");

View File

@@ -18,7 +18,9 @@ var should = require("should");
var fs = require('fs-extra');
var path = require('path');
var localfilesystemSettings = require("../../../../../red/runtime/storage/localfilesystem/settings");
var NR_TEST_UTILS = require("nr-test-utils");
var localfilesystemSettings = NR_TEST_UTILS.require("@node-red/runtime/lib/storage/localfilesystem/settings");
describe('storage/localfilesystem/settings', function() {
var userDir = path.join(__dirname,".testUserHome");

View File

@@ -15,7 +15,8 @@
**/
var should = require("should");
var util = require("../../../../../red/runtime/storage/localfilesystem/util");
var NR_TEST_UTILS = require("nr-test-utils");
var util = NR_TEST_UTILS.require("@node-red/runtime/lib/storage/localfilesystem/util");
describe('storage/localfilesystem/util', function() {
describe('parseJSON', function() {