mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-10-26 02:32:26 +01:00
fix debug tests
This commit is contained in:
@@ -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({
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user