fix debug tests

This commit is contained in:
Phillip Thelen
2024-06-19 17:30:37 +02:00
parent 19da14531c
commit 3386d61fde
8 changed files with 8 additions and 8 deletions

View File

@@ -28,7 +28,7 @@ describe('GET /debug/time-travel-time', () => {
});
it('returns error when not in time travel mode', async () => {
nconf.set('TIME_TRAVEL_ENABLED', false);
sandbox.stub(nconf, 'get').withArgs('TIME_TRAVEL_ENABLED').returns(false);
await expect(user.get('/debug/time-travel-time'))
.eventually.be.rejected.and.to.deep.equal({

View File

@@ -23,7 +23,7 @@ describe('POST /debug/add-hourglass', () => {
});
it('returns error when not in production mode', async () => {
nconf.set('IS_PROD', true);
sandbox.stub(nconf, 'get').withArgs('IS_PROD').returns(true);
await expect(userToGetHourGlass.post('/debug/add-hourglass'))
.eventually.be.rejected.and.to.deep.equal({

View File

@@ -23,7 +23,7 @@ describe('POST /debug/add-ten-gems', () => {
});
it('returns error when not in production mode', async () => {
nconf.set('IS_PROD', true);
sandbox.stub(nconf, 'get').withArgs('IS_PROD').returns(true);
await expect(userToGainTenGems.post('/debug/add-ten-gems'))
.eventually.be.rejected.and.to.deep.equal({

View File

@@ -63,7 +63,7 @@ describe('POST /debug/jump-time', () => {
});
it('returns error when not in time travel mode', async () => {
nconf.set('TIME_TRAVEL_ENABLED', false);
sandbox.stub(nconf, 'get').withArgs('TIME_TRAVEL_ENABLED').returns(false);
await expect(user.post('/debug/jump-time', { offsetDays: 1 }))
.eventually.be.rejected.and.to.deep.equal({

View File

@@ -23,7 +23,7 @@ describe('POST /debug/make-admin', () => {
});
it('returns error when not in production mode', async () => {
nconf.set('IS_PROD', true);
sandbox.stub(nconf, 'get').withArgs('IS_PROD').returns(true);
await expect(user.post('/debug/make-admin'))
.eventually.be.rejected.and.to.deep.equal({

View File

@@ -149,7 +149,7 @@ describe('POST /debug/modify-inventory', () => {
});
it('returns error when not in production mode', async () => {
nconf.set('IS_PROD', true);
sandbox.stub(nconf, 'get').withArgs('IS_PROD').returns(true);
await expect(user.post('/debug/modify-inventory'))
.eventually.be.rejected.and.to.deep.equal({

View File

@@ -48,7 +48,7 @@ describe('POST /debug/quest-progress', () => {
});
it('returns error when not in production mode', async () => {
nconf.set('IS_PROD', true);
sandbox.stub(nconf, 'get').withArgs('IS_PROD').returns(true);
await expect(user.post('/debug/quest-progress'))
.eventually.be.rejected.and.to.deep.equal({

View File

@@ -27,7 +27,7 @@ describe('POST /debug/set-cron', () => {
});
it('returns error when not in production mode', async () => {
nconf.set('IS_PROD', true);
sandbox.stub(nconf, 'get').withArgs('IS_PROD').returns(true);
await expect(user.post('/debug/set-cron'))
.eventually.be.rejected.and.to.deep.equal({