We consider testing for the presence of nonlinearities in the deterministic component of a time series, approximating the potential nonlinear behaviour using a Fourier function expansion. In contrast to procedures that are currently available, we develop tests that are robust to the order of integration, in the sense that they are asymptotically correctly sized regardless of whether the stochastic component of the series is stationary or contains a unit root. The tests we propose take the form of Wald statistics based on cumulated series, together with a correction factor to line up the asymptotic critical values across the I(0) and I(1) environments. The local asymptotic power and finite sample properties of the tests are evaluated using various different correction factors. We envisage that the testing procedure we recommend should be very useful to applied researchers wishing to draw robust inference regarding the presence of nonlinear deterministic components in a series.