Hello 
In the unit tests, no app is launched, only the code required by the test file is used. Thus, the global variable strapi doesn’t exist. You can do const utils = require('./utils') and then call your function with utils.checkProfanity (without using the global variable strapi).
2 Likes