Skip to content

Commit b8f0c9c

Browse files
committed
test: add warn method to mock logger
1 parent 792720d commit b8f0c9c

7 files changed

+42
-7
lines changed

test/add-channel.test.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ test.beforeEach((t) => {
1212
// Mock logger
1313
t.context.log = sinon.stub();
1414
t.context.error = sinon.stub();
15-
t.context.logger = { log: t.context.log, error: t.context.error };
15+
t.context.warn = sinon.stub();
16+
t.context.logger = {
17+
log: t.context.log,
18+
error: t.context.error,
19+
warn: t.context.warn,
20+
};
1621
});
1722

1823
test("Update a release", async (t) => {

test/fail.test.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ test.beforeEach((t) => {
1414
// Mock logger
1515
t.context.log = sinon.stub();
1616
t.context.error = sinon.stub();
17-
t.context.logger = { log: t.context.log, error: t.context.error };
17+
t.context.warn = sinon.stub();
18+
t.context.logger = {
19+
log: t.context.log,
20+
error: t.context.error,
21+
warn: t.context.warn,
22+
};
1823
});
1924

2025
test("Open a new issue with the list of errors", async (t) => {

test/find-sr-issue.test.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ test.beforeEach((t) => {
1010
// Mock logger
1111
t.context.log = sinon.stub();
1212
t.context.error = sinon.stub();
13-
t.context.logger = { log: t.context.log, error: t.context.error };
13+
t.context.warn = sinon.stub();
14+
t.context.logger = {
15+
log: t.context.log,
16+
error: t.context.error,
17+
warn: t.context.warn,
18+
};
1419
});
1520

1621
test("Filter out issues without ID", async (t) => {

test/integration.test.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ test.beforeEach(async (t) => {
1313
// Stub the logger
1414
t.context.log = sinon.stub();
1515
t.context.error = sinon.stub();
16-
t.context.logger = { log: t.context.log, error: t.context.error };
16+
t.context.warn = sinon.stub();
17+
t.context.logger = {
18+
log: t.context.log,
19+
error: t.context.error,
20+
warn: t.context.warn,
21+
};
1722
});
1823

1924
test("Verify GitHub auth", async (t) => {

test/publish.test.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ test.beforeEach((t) => {
1515
// Mock logger
1616
t.context.log = sinon.stub();
1717
t.context.error = sinon.stub();
18-
t.context.logger = { log: t.context.log, error: t.context.error };
18+
t.context.warn = sinon.stub();
19+
t.context.logger = {
20+
log: t.context.log,
21+
error: t.context.error,
22+
warn: t.context.warn,
23+
};
1924
});
2025

2126
test("Publish a release without creating discussion", async (t) => {

test/success.test.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ test.beforeEach((t) => {
1616
// Mock logger
1717
t.context.log = sinon.stub();
1818
t.context.error = sinon.stub();
19-
t.context.logger = { log: t.context.log, error: t.context.error };
19+
t.context.warn = sinon.stub();
20+
t.context.logger = {
21+
log: t.context.log,
22+
error: t.context.error,
23+
warn: t.context.warn,
24+
};
2025
});
2126

2227
test("Add comment and labels to PRs associated with release commits and issues solved by PR/commits comments", async (t) => {

test/verify.test.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ test.beforeEach((t) => {
1212
// Mock logger
1313
t.context.log = sinon.stub();
1414
t.context.error = sinon.stub();
15-
t.context.logger = { log: t.context.log, error: t.context.error };
15+
t.context.warn = sinon.stub();
16+
t.context.logger = {
17+
log: t.context.log,
18+
error: t.context.error,
19+
warn: t.context.warn,
20+
};
1621
});
1722

1823
test("Verify package, token and repository access", async (t) => {

0 commit comments

Comments
 (0)