{"id":"iibhf-devteam/iibhf-tester","name":"iibhf-tester","scope":"iibhf-devteam","platform":"roblox","description":"A simple testing library for roblox games.","version":"0.1.3","latest":"0.1.3","versions":["0.1.0","0.1.1","0.1.2","0.1.3"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{"evaera/promise":{"version":"^4.0.0","alias":"promise"}},"integrity":"10e4ce010633f78a259c6b0888c33b97fcd51e451a45d69c2448c84b13d36378","likes":0,"downloads":0,"install":"forest install iibhf-devteam/iibhf-tester","url":"https://forest.dev/p/roblox/iibhf-devteam/iibhf-tester","files":"https://api.forest.dev/ai/package/roblox/iibhf-devteam/iibhf-tester/files","readme":"# IIBHF-Tester\r\nA simple testing library for roblox games.\r\n\r\n# Setup\r\n## Project\r\nThis project uses [Rojo](https://github.com/rojo-rbx/rojo), some Rojo project files are included, 3 to be exact\r\n* ``default.project.json`` is the project file that you should probably be using, this one packs it to be compatible with Wally\r\n* ``default-standalone.project.json`` is the project file for people who don't want to use wally\r\n* ``test.project.json`` is used to demo the tester(and to test it)\r\n\r\nIn order to build the desired copy, run\r\n```bash\r\nwally install\r\nrojo build {project file you want to use} --output IIBHFTester.rbxm\r\n```\r\n## Example\r\nThis is an example of a test for server\r\n```\r\nlocal Repstore = game:GetService(\"ReplicatedStorage\")\r\nlocal Tester = require(Repstore.IIBHFTester)\r\n\r\nlocal exTest = Tester.new(\"Example\", false, function() print(\"Oh no! My test! It broken!\") end, function() print(\"how....\") end)\r\nlocal foo = Tester.NewServerTest(exTest, \"foo\", function() return 3*4==12 end, nil)\r\nlocal bar = Tester.NewServerTest(exTest, \"bar\", function() return 44+44==32498 end, nil)\r\nTester.StartServerTestSuite(exTest)\r\n```\r\nWhen a test returns ``false``, it means the test has failed, in this example ``bar`` is set to fail as ``44+44`` equals 88 and not 32498, When a test returns ``true``, it means the test has passed, in this example, ``foo`` is set to pass as ``3*4`` does equal 12\r\n\r\nYou can find this inside ``./test/ServerScriptService/ServerTestExample.server.lua``,\r\nthere is also a client version in ``./test/StarterPlayer/StarterPlayerScripts/ClientTestExample.client.luau``\r\n\r\nAll the ``DoesItFail`` files are made to error out, ``DoesItFail.server.luau`` tries to make client tests and vice versa for ``DoesItFail.client.luau``\r\n\r\n## API\r\n``IIBHFTester.CanRun(TestSuite: any)`` - Takes in a test suite and checks to see if it can currently run\r\n\r\n``IIBHFTester.NewServerTester(TestSuiteName: string, RunOutsideOfStudio: boolean, OnTestEndWithFail: () -> (), OnTestEndWithoutFail: () -> ()): any`` - Makes a new test suite, it will return an ``IIBHFServerTester``, ``OnTestEndWithFail`` and ``OnTestEndWithout`` will run depending on if there were tests that failed or not.\r\n\r\n``IIBHFTester.NewClientTester(TestSuiteName: string, RunOutsideOfStudio: boolean, OnTestEndWithFail: () -> (), OnTestEndWithoutFail: () -> ()): any`` - Same thing as ``NewServerTester`` but for client.\r\n\r\n``IIBHFTester.NewServerTest(TestSuite: IIBHFServerTester, TestName: string, TestFunc: (ServerTest) -> boolean, CondToSkip: (ServerTest) -> boolean)`` TestFunc and CondToSkip both return bools, if CondToSkip is ``nil`` then the test will never skip, both ``TestFunc`` and ``CondToSkip`` will have the Test accessible as parameters, will error if ran on a client\r\n\r\n``IIBHFTester.NewClientTest(TestSuite: IIBHFClientTester, TestName: string, TestFunc: (ClientTest) -> boolean, CondToSkip: (ClientTest) -> boolean)`` same thing as ``NewServerTest`` but with Client types and only avaliable on client, will error if ran on the server\r\n\r\n``IIBHFTester.StartServerTestSuite(TestSuite: IIBHFServerTester)`` Runs a server test suite, will error out if given a client test suite\r\n\r\n``IIBHFTester.StartClientTestSuite(TestSuite: IIBHFClientTester)`` Runs a client test suite, will error out if given a server test suite\r\n\r\n## Customizability\r\nSet ``GameName`` in ``src/init.luau`` to your game's name!\r\n\r\n# License\r\nThis project is avaliable under the MIT License. See [LICENSE](https://github.com/IIBHF-DevTeam/iibhf-tester/blob/73cd3c188a9996762f0437f901aaf6f7b86d654d/LICENSE) for details\r\n","readmeTruncated":false}