require-tests: move require("fs") into server-only block