Please see issues linked below.
Rdatatable/data.table#2023
Rdatatable/data.table#2053
It seems that test() and load_all() and possibly others have recently changed behaviour with regards to resolving imported packages, at least with regards to the 'data.table' package.
Testing of perfectly valid code should not fail like that.