Steps to reproduce starting with docker to ensure clean environment (remove.packages("xts") would probably works too instead of docker run).
docker run --net=host -it jangorecki/r-base-dev
install.packages("data.table", repos = "https://Rdatatable.github.io/data.table")
library(data.table)
test.data.table()
#...
#Running test id 1559.1     Test 1559.1 Error in loadNamespace(name) : there is no package called ‘xts’
#Error in eval(expr, envir, enclos) : 
#  1 error out of 4418 (lastID=1602.2, endian=little, sizeof(long double)==16) in inst/tests/tests.Rraw on Sun Feb 28 19:56:02 2016. Search tests.Rraw for test number 1559.1.
Wrapping into requireNamespace should be sufficient.