Skip to content

Commit

Permalink
make tests work again
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Dec 19, 2024
1 parent 413d7c1 commit 7905e0b
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 220 deletions.
1 change: 1 addition & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MONGODB_CONNECTION_STRING=mongodb://127.0.0.1:27017/mongoose_test
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
},
"devDependencies": {
"@mongoosejs/migrations": "0.2.5",
"dotenv": "16.4.7",
"mocha": "9.1.3",
"sinon": "12.0.1"
},
Expand Down
14 changes: 2 additions & 12 deletions test/createReleaseFromChangelog.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,15 @@ const changelog = `
`.trim();

describe('createReleaseFromChangelog', function() {
let Task;
let task;
before(() => {
Task = conn.model('Task', TaskSchema);
});

beforeEach(async function() {
task = await Task.create({});
});

it('creates a draft release', async function() {
sinon.stub(githubOAuth, 'getChangelog').callsFake(() => Promise.resolve(changelog));
sinon.stub(githubOAuth, 'createRelease').callsFake(() => Promise.resolve());
await createReleaseFromChangelog(task)('6.1.1');
await createReleaseFromChangelog('6.1.1');

const [tagAndName, body] = githubOAuth.createRelease.getCall(0).args;
assert.equal(tagAndName, '6.1.1');
assert.equal(body, changelog);
const [{ branch }] = githubOAuth.getChangelog.getCall(0).args;
assert.equal(branch, '6.x');
});
});
});
27 changes: 0 additions & 27 deletions test/githubLogin.test.js

This file was deleted.

4 changes: 3 additions & 1 deletion test/setup.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict';

require('dotenv').config({ path: './.env.test' });

const connect = require('../src/db');

global.conn = null;
Expand All @@ -10,4 +12,4 @@ before(async function() {

after(async function() {
await global.conn.close();
});
});
73 changes: 0 additions & 73 deletions test/webhookGithubApp.test.js

This file was deleted.

107 changes: 0 additions & 107 deletions test/webhookGithubSponsors.test.js

This file was deleted.

0 comments on commit 7905e0b

Please sign in to comment.