BAC-984: improve an assert in JS unit test