wrap-state with phantomjs mode