Jump to content

Unit testing in MTA


cacao

Recommended Posts

mta-unit-tests

-- Example test
-- @usage
-- First, we need unit test in global table
-- Then, we can describe tests
g_Tests = g_Tests or {}
g_Tests[#g_Tests+1] = {
  -- Description of testSuite
  ["_NAME"] = "testSuite:example simplify assert test, should return true",
  -- Name of assert
  ["testExample"] = function()
    assert(true, "that was true!")
  end,
  -- Second name another assert
  ["testAnotherExample"] = function()
    assertEqual(true, false, "that second assert, should equals!")
  end
}

Based script: Lunity 


https://github.com/READYTOMASSACRE/mta-unit-tests

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...