This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
tstatic/src/__tests__/helpers.ts

12 lines
329 B
TypeScript
Raw Normal View History

2017-02-19 18:19:45 +00:00
import createServer from '../server';
import { Options } from '../types';
import fetch from 'node-fetch';
export function runServer(opts: Object, url : string, callback: Function) {
return createServer(opts as Options).listen(1234, function () {
return fetch('http://0.0.0.0:1234' + url).then(callback);
});
}