Update wsc-test.js

refactor wrapping