No, you can't leave the "that" out.
There are two distinct verbs in the sentence: "test" and "works". And so, to put it simply, you need to do something to show the relationship between the two verbs. In this case, you need to say what you are testing. The word "that" indicates that what follows is the thing that the verb "test" applies to.
There are other words that could fit in this place. You could say, "Test when it works" or "Test why it works" or "Test how it works", all of which change the meaning of the sentence. "Test that it works" indicates that the expected result will be yes or no, it works or it does not. "Test when it works" would lead to a description of the time or circumstances. Etc.