mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Added fixture path utility to e2e-framework
- Always want to be able to safely get a fixture path without needing the path util - Means tests can be moved around more easily
This commit is contained in:
parent
25e5cb46de
commit
3784d79682
2 changed files with 6 additions and 3 deletions
|
@ -42,7 +42,7 @@ describe('Authentication API', function () {
|
|||
const requestMock = nock('https://api.github.com')
|
||||
.get('/repos/tryghost/dawn/zipball')
|
||||
.query(true)
|
||||
.replyWithFile(200, __dirname + '/../../../utils/fixtures/themes/valid.zip');
|
||||
.replyWithFile(200, fixtureManager.getPathForFixture('themes/valid.zip'));
|
||||
|
||||
await agent
|
||||
.post('authentication/setup')
|
||||
|
@ -166,7 +166,7 @@ describe('Authentication API', function () {
|
|||
const requestMock = nock('https://api.github.com')
|
||||
.get('/repos/tryghost/casper/zipball')
|
||||
.query(true)
|
||||
.replyWithFile(200, __dirname + '/../../../utils/fixtures/themes/valid.zip');
|
||||
.replyWithFile(200, fixtureManager.getPathForFixture('themes/valid.zip'));
|
||||
|
||||
await cleanAgent
|
||||
.post('authentication/setup')
|
||||
|
|
|
@ -271,7 +271,10 @@ module.exports = {
|
|||
get: getFixture,
|
||||
getCurrentOwnerUser: fixtureUtils.getCurrentOwnerUser,
|
||||
init: initFixtures,
|
||||
restore: resetData
|
||||
restore: resetData,
|
||||
getPathForFixture: (fixturePath) => {
|
||||
return path.join(__dirname, 'fixtures', fixturePath);
|
||||
}
|
||||
},
|
||||
matchers: {
|
||||
anyString: any(String),
|
||||
|
|
Loading…
Add table
Reference in a new issue