Throwing up etc

Having bad stomach pains since yesterday , threw up , craving pickles , but my period starts in two days. Can i take a test or ?