Background. Previous work suggests that the expectation of failure is related to higher test anxiety and achievement goals grounded in a fear of failure. Aim. To test the hypothesis, based on the work of Elliot and Pekrun (2007), that the relationship between perceived competence and test anxiety is mediated by achievement goal orientations. Sample. Self-report data were collected from 275 students in post-compulsory education following courses in A Level Psychology. Results. Competence beliefs were inversely related to the worry and tension components of test anxiety, both directly and indirectly through a performance-avoidance goal orientation. A mastery-avoidance goal orientation offered an indirect route from competence beliefs to worry only. Conclusion. These findings provide partial support for Elliot and Pekrun's (2007) model. Although significant mediating effects were found for mastery-avoidance and performance-avoidance goals, they were small and there may be other mechanisms to account for the relations between competence beliefs and test anxiety.