Flamework TestEZ
Are there any examples of how to test services or controllers? I figure I'd have to use the Dependency macro, but I'm unsure how.
10 Replies
I want to do something like this. The first print will work but the second does not.
I'm assuming using the Dependency macro is not advised here?
I think littensy had an example of jecs running in play mode
I looked pretty good I think, most of the repos are Luau or just using Jest w no Flamework.
https://github.com/littensy/rbxts-jest-test/blob/main/test/spec.server.lua#L1
Im pretty sure you can just run this in a .server.ts file
that's the only way beacuse flamework cant start if the game isnt running
Yeah I understand that part
I already have the whole system down using TestEZ
It's just using the dependency macro inside of the testing export yields infinitely or something.
It doesn't throw an error
maybe its the environment mocking
try printing
_G
outside and inside tests
check if its the same oneMk I'll give it a try
["__TESTEZ_RUNNING_TEST__"] = true
Not the same one.
When I use the macro outside of the export I get this error upon running the test.
Running error for ServerScriptService.TS.tests.player.spec: [string "ReplicatedStorage.rbxts_include.node_modules.@flamework.core.out.modding"]:509: Could not find constructor for server/player/player-service@PlayerService while constructing ArtificialDependency
jecs?
I think ur too obsesssed with ecs ❤️
A
LOL
they have similar names
I actually thought jecs was for testing
💀
I sometimes type them wrong too