Formal agreement to dine during test (6)
I believe the answer is:
treaty
'formal agreement' is the definition.
(I've seen this before)
'dine during test' is the wordplay.
'dine' becomes 'eat' (I've seen this before).
'during' indicates putting letters inside.
'test' becomes 'try' (synonyms).
'eat' put into 'try' is 'TREATY'.
'to' is the link.
(Other definitions for treaty that I've seen before include "something of Rome or Versailles?" , "Formal agreement between governments" , "Deal?" , "Compact; concordat" , "Formal agreement between states" .)