mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
Sped up comments and feedback tests by reusing Ghost app instance
refs https://ghost.slack.com/archives/C02G9E68C/p1668777066462859 Added a duplicate method to the mmebers agent, so we can reuse the same app instance and options, whenever we need multiple agents (each with their own cookies).
This commit is contained in:
parent
bb91bfd1ee
commit
2220686113
@ -184,7 +184,7 @@ describe('Comments API', function () {
|
||||
|
||||
before(async function () {
|
||||
membersAgent = await agentProvider.getMembersAPIAgent();
|
||||
membersAgent2 = await agentProvider.getMembersAPIAgent();
|
||||
membersAgent2 = membersAgent.duplicate();
|
||||
|
||||
await fixtureManager.init('posts', 'members', 'comments');
|
||||
|
||||
|
@ -10,7 +10,7 @@ describe('Members Feedback', function () {
|
||||
|
||||
before(async function () {
|
||||
membersAgent = await agentProvider.getMembersAPIAgent();
|
||||
membersAgent2 = await agentProvider.getMembersAPIAgent();
|
||||
membersAgent2 = membersAgent.duplicate();
|
||||
|
||||
await fixtureManager.init('posts', 'members');
|
||||
memberUuid = fixtureManager.get('members', 0).uuid;
|
||||
|
@ -12,8 +12,15 @@ const errors = require('@tryghost/errors');
|
||||
* @param {String} options.originURL
|
||||
*/
|
||||
class MembersAPITestAgent extends TestAgent {
|
||||
#bootOptions = null;
|
||||
|
||||
constructor(app, options) {
|
||||
super(app, options);
|
||||
this.#bootOptions = options;
|
||||
}
|
||||
|
||||
duplicate() {
|
||||
return new MembersAPITestAgent(this.app, this.#bootOptions);
|
||||
}
|
||||
|
||||
async loginAs(email) {
|
||||
|
Loading…
Reference in New Issue
Block a user