Unit test assignment val/ref JS