Use test function in both node and web loader