Skip to content

Commit

Permalink
test: add warn method to mock logger
Browse files Browse the repository at this point in the history
  • Loading branch information
babblebey committed Sep 11, 2024
1 parent 792720d commit b8f0c9c
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 7 deletions.
7 changes: 6 additions & 1 deletion test/add-channel.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ test.beforeEach((t) => {
// Mock logger
t.context.log = sinon.stub();
t.context.error = sinon.stub();
t.context.logger = { log: t.context.log, error: t.context.error };
t.context.warn = sinon.stub();
t.context.logger = {
log: t.context.log,
error: t.context.error,
warn: t.context.warn,
};
});

test("Update a release", async (t) => {
Expand Down
7 changes: 6 additions & 1 deletion test/fail.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ test.beforeEach((t) => {
// Mock logger
t.context.log = sinon.stub();
t.context.error = sinon.stub();
t.context.logger = { log: t.context.log, error: t.context.error };
t.context.warn = sinon.stub();
t.context.logger = {
log: t.context.log,
error: t.context.error,
warn: t.context.warn,
};
});

test("Open a new issue with the list of errors", async (t) => {
Expand Down
7 changes: 6 additions & 1 deletion test/find-sr-issue.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ test.beforeEach((t) => {
// Mock logger
t.context.log = sinon.stub();
t.context.error = sinon.stub();
t.context.logger = { log: t.context.log, error: t.context.error };
t.context.warn = sinon.stub();
t.context.logger = {
log: t.context.log,
error: t.context.error,
warn: t.context.warn,
};
});

test("Filter out issues without ID", async (t) => {
Expand Down
7 changes: 6 additions & 1 deletion test/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ test.beforeEach(async (t) => {
// Stub the logger
t.context.log = sinon.stub();
t.context.error = sinon.stub();
t.context.logger = { log: t.context.log, error: t.context.error };
t.context.warn = sinon.stub();
t.context.logger = {
log: t.context.log,
error: t.context.error,
warn: t.context.warn,
};
});

test("Verify GitHub auth", async (t) => {
Expand Down
7 changes: 6 additions & 1 deletion test/publish.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ test.beforeEach((t) => {
// Mock logger
t.context.log = sinon.stub();
t.context.error = sinon.stub();
t.context.logger = { log: t.context.log, error: t.context.error };
t.context.warn = sinon.stub();
t.context.logger = {
log: t.context.log,
error: t.context.error,
warn: t.context.warn,
};
});

test("Publish a release without creating discussion", async (t) => {
Expand Down
7 changes: 6 additions & 1 deletion test/success.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ test.beforeEach((t) => {
// Mock logger
t.context.log = sinon.stub();
t.context.error = sinon.stub();
t.context.logger = { log: t.context.log, error: t.context.error };
t.context.warn = sinon.stub();
t.context.logger = {
log: t.context.log,
error: t.context.error,
warn: t.context.warn,
};
});

test("Add comment and labels to PRs associated with release commits and issues solved by PR/commits comments", async (t) => {
Expand Down
7 changes: 6 additions & 1 deletion test/verify.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ test.beforeEach((t) => {
// Mock logger
t.context.log = sinon.stub();
t.context.error = sinon.stub();
t.context.logger = { log: t.context.log, error: t.context.error };
t.context.warn = sinon.stub();
t.context.logger = {
log: t.context.log,
error: t.context.error,
warn: t.context.warn,
};
});

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

0 comments on commit b8f0c9c

Please sign in to comment.