translate specs to js