diff --git a/nexss-test/commands/test.js b/nexss-test/commands/test.js index a20a793..a10bf4d 100644 --- a/nexss-test/commands/test.js +++ b/nexss-test/commands/test.js @@ -135,6 +135,9 @@ testNames.forEach(test => { } test.tests.forEach(subtest => { + if (test.notEval && !subtest.notEval) { + subtest.notEval = test.notEval; + } tests++; if (cliArgs.startFromTest) { if (isNaN(cliArgs.startFromTest)) { @@ -158,7 +161,7 @@ testNames.forEach(test => { console.log(`===========================================`); eval(subtest.type || "shouldContain")( ...subtest.params.map(p => { - if (p !== null && typeof p === "object") { + if ((p !== null && typeof p === "object") || subtest.notEval) { return p; } else { return evalTS(p); diff --git a/nexss-test/tests/env.nexss-test.js b/nexss-test/tests/env.nexss-test.js new file mode 100644 index 0000000..3868468 --- /dev/null +++ b/nexss-test/tests/env.nexss-test.js @@ -0,0 +1,52 @@ +let values = ["Nexss"]; + +module.exports = { + values, + startFrom: "", + endsWith: "", + omit: [], + tests: [ + { + title: "NEXSS_ environment variables", + onError: "stop", // global value, + notEval: true, // Means that parameters will not be evaluated (like below it ${..} will be passed) + tests: [ + { + title: "NEXSS_APPS_PATH", + params: [ + "nexss id --testEnv=${process.env.NEXSS_APPS_PATH}", + /"testEnv":".*\\\\\.nexssApps/ + ] + }, + { + title: "NEXSS_LANGUAGES_PATH", + params: [ + "nexss id --testEnv=${process.env.NEXSS_LANGUAGES_PATH}", + /"testEnv":".*\\\\\.nexss\\\\languages/ + ] + }, + { + title: "NEXSS_HOME_PATH", + params: [ + "nexss id --testEnv=${process.env.NEXSS_HOME_PATH}", + /"testEnv":".*\\\\\.nexss"/ + ] + } + ] + } + // { + // title: "nexss-command", + // onError: "stop", // global value + // tests: [ + // { + // title: "Check not in the folder", + // type: "shouldContain", + // params: [ + // "nexss cmd", + // "You are not in the Nexss Programmer project folder." + // ] + // } + // ] + // } + ] +};