Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: remove spurious logging from unit tests #575

Merged
merged 2 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/device-api/tests/zod-rpc.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ function testIo () {
}

describe('device-api', () => {
beforeAll(() => {
jest.spyOn(console, 'log').mockImplementation(() => {})
})
afterAll(() => {
jest.restoreAllMocks()
})

it('can send notification messages in old format', async () => {
const { handler, transport } = testIo()
await handler.notify(createDeviceApiCall('hello-world', { id: 1 }))
Expand Down
6 changes: 4 additions & 2 deletions scripts/release/create-pr-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ function createPRTemplate (platform, data) {
return updatedTemplate
}

// The log is needed to read the value from the bash context
console.log(createPRTemplate(platform, data))
// Only log when executed directly via `node scripts/release/create-pr-template.js`
if (require.main === module) {
console.log(createPRTemplate(platform, data))
}

module.exports = {createPRTemplate}
7 changes: 7 additions & 0 deletions src/Form/matching.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ describe('vendor-regexes matching', () => {
})

describe('matching', () => {
beforeAll(() => {
jest.spyOn(console, 'warn').mockImplementation(() => {})
})
afterAll(() => {
jest.restoreAllMocks()
})

it('default config', () => {
const matching = new Matching(Matching.emptyConfig)
const {formElement, inputs} = setFormHtml(`<input name=email />`)
Expand Down
Loading