Skip to content

Commit 7905e0b

Browse files
committed
make tests work again
1 parent 413d7c1 commit 7905e0b

File tree

7 files changed

+7
-220
lines changed

7 files changed

+7
-220
lines changed

.env.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
MONGODB_CONNECTION_STRING=mongodb://127.0.0.1:27017/mongoose_test

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
},
1616
"devDependencies": {
1717
"@mongoosejs/migrations": "0.2.5",
18+
"dotenv": "16.4.7",
1819
"mocha": "9.1.3",
1920
"sinon": "12.0.1"
2021
},

test/createReleaseFromChangelog.test.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,15 @@ const changelog = `
1313
`.trim();
1414

1515
describe('createReleaseFromChangelog', function() {
16-
let Task;
17-
let task;
18-
before(() => {
19-
Task = conn.model('Task', TaskSchema);
20-
});
21-
22-
beforeEach(async function() {
23-
task = await Task.create({});
24-
});
25-
2616
it('creates a draft release', async function() {
2717
sinon.stub(githubOAuth, 'getChangelog').callsFake(() => Promise.resolve(changelog));
2818
sinon.stub(githubOAuth, 'createRelease').callsFake(() => Promise.resolve());
29-
await createReleaseFromChangelog(task)('6.1.1');
19+
await createReleaseFromChangelog('6.1.1');
3020

3121
const [tagAndName, body] = githubOAuth.createRelease.getCall(0).args;
3222
assert.equal(tagAndName, '6.1.1');
3323
assert.equal(body, changelog);
3424
const [{ branch }] = githubOAuth.getChangelog.getCall(0).args;
3525
assert.equal(branch, '6.x');
3626
});
37-
});
27+
});

test/githubLogin.test.js

Lines changed: 0 additions & 27 deletions
This file was deleted.

test/setup.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict';
22

3+
require('dotenv').config({ path: './.env.test' });
4+
35
const connect = require('../src/db');
46

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

1113
after(async function() {
1214
await global.conn.close();
13-
});
15+
});

test/webhookGithubApp.test.js

Lines changed: 0 additions & 73 deletions
This file was deleted.

test/webhookGithubSponsors.test.js

Lines changed: 0 additions & 107 deletions
This file was deleted.

0 commit comments

Comments
 (0)