Module:WikiProject assessment progression/testcases

This is an old revision of this page, as edited by Sasuke Sarutobi (talk | contribs) at 02:08, 4 December 2020 (Rename for clarity as numberness of string isn't being tested; add comments for test motivations). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
-- Unit tests for [[Module:WikiProject assessment progression]]. Click talk page to run tests.
local myModule = require('Module:WikiProject assessment progression/sandbox')
local ScribuntoUnit = require('Module:ScribuntoUnit')
local suite = ScribuntoUnit:new()

function suite:assertTypeEquals(expectedType, functionName)
	local outputType = type(functionName)
	self:assertEquals(expectedType, outputType)
end

-- Confirm test function itself is working
function suite:test_assertTypeEquals_returns_correctly()
	self:assertTypeEquals('number', 10)
end

-- Confirm output is a string
function suite:test_module_outputs_as_string()
	self:assertTypeEquals('string', '{{#invoke:WikiProject assessment progression|main|project=spaceflight}}')
end

return suite