mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 18:31:57 +03:00
4b5b3de11c
- these agent files are all very similar and should be grouped together - moving them into a subfolder makes the `test/utils` folder a little bit easier to browse
24 lines
585 B
JavaScript
24 lines
585 B
JavaScript
const Agent = require('@tryghost/express-test');
|
|
|
|
/**
|
|
* @constructor
|
|
* @param {Object} app Ghost express app instance
|
|
* @param {Object} options
|
|
* @param {String} options.apiURL
|
|
* @param {String} options.originURL
|
|
*/
|
|
class TestAgent extends Agent {
|
|
constructor(app, options) {
|
|
super(app, {
|
|
baseUrl: options.apiURL,
|
|
headers: {
|
|
host: options.originURL.replace(/http:\/\//, ''),
|
|
origin: options.originURL
|
|
},
|
|
queryParams: options.queryParams
|
|
});
|
|
}
|
|
}
|
|
|
|
module.exports = TestAgent;
|