What is this file generally? Looks really complicated. Maybe best bet is move test libs out of AMD / require.