Nexss Programmer Testing

Nexss Programmer testing framework - beta version

nexss test # if you are not in the Nexss Programmer project will display global tests like Nexss Core
nexss test all # will run all tests in the folder test.nexss (global or project)
nexss Id test all # (will run the test for package) in this case package Id

nexss test to display available tests (if you are in the nexss programmer project then it will display the project related tests which is main folder of the project ./test.nexss)

Example: Languages tests

Global parameters

values- (optional) extensions of languages [".js",".pl",".lua","tcl"]
startFrom - (optional) eg: ".pl" - will start testing from the .pl ommiting the .js (handy in the development)
EndWith - (optional) eg: ".lua" - will stop testing on .lua (handy in the development)
ommit - (optional) eg: [".pl",".lua"] - will ommit these 2 languages..

Each Test parameters

tests (required):

  • title - display during testing, the title for the test
  • type - shouldContain, shouldNotContain (self explanetory)
    Below is just example when changed shouldContain -> shouldNotContain - display what should not be there... image

  • params - [commandToExe, StringOrRegularExpression, options]

    • commandToExe - eg: nexss file add Default${ext} --t=default --f - where ${ext} will be replaced by the actual value
    • StringOrRegularExpression - eg: OK File (.*) has been created - regular expression which need to be found OR shouldn't be there (depends on shouldContain or shouldNotContain)
    • options - for now only options.chdir is available eg: {chdir: "MyTestProject"}
module.exports = {
  startFrom: "",
  endsWith: "",
  omit: [
    ".html", // No json parsing
    ".json", // To Add combine json
  tests: [
      title: "Test Compilers",      
      tests: [
          title: "Creating file for ${ext}",
          type: "shouldContain",
          params: [
            "nexss file add Default${ext} --t=default --f",
            "OK  File (.*) has been created"
          title: "Test without Unicode",
          type: "shouldContain",
          params: ["nexss Default${ext}", `"test":(.*)"test"`]
          title: "Test Unicode characters",
          type: "shouldContain",
          params: ["nexss Default${ext} --test", `"test":(.*)"test"`]