[build] rework JS tests building