-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add Unit Tests and Github Actions Step for Unit Tests #37
base: develop
Are you sure you want to change the base?
Conversation
Sandbox Executions
Run .github/workflows/main.yml through the sandbox.
|
Apply Sweep Rules to your PR?
|
}); | ||
}); | ||
|
||
describe("request", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').
Too many errors. (73% scanned).
const item = { | ||
/* some item */ | ||
}; | ||
reporter.beforeItem(null, { item }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'object short notation' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
|
||
describe("beforeItem", () => { | ||
it("updates the context correctly", () => { | ||
const item = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
}); | ||
|
||
describe("beforeItem", () => { | ||
it("updates the context correctly", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').
}); | ||
}); | ||
|
||
describe("beforeItem", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').
}); | ||
}); | ||
|
||
beforeEach(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').
|
||
describe("done", () => { | ||
it("disconnects the service correctly", () => { | ||
const disconnect = jest.spyOn(reporter.service, "disconnect"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
}); | ||
|
||
describe("done", () => { | ||
it("disconnects the service correctly", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').
}); | ||
}); | ||
|
||
describe("done", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').
/* some item */ | ||
}; | ||
reporter.context.currentItem = item; | ||
const sendData = jest.spyOn(reporter.service, "sendData"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
SonarCloud Quality Gate failed. 0 Bugs No Coverage information Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
PR Feedback (click)
Description
This PR adds unit tests for the
InfluxDBReporter
class in thesrc/influxdb-reporter.js
file. The tests cover all public methods of the class and include test cases for various scenarios and edge cases. Additionally, a new step is added to the Github Actions workflow file.github/workflows/main.yml
to run the unit tests as part of the CI/CD pipeline.Summary of Changes
test/influxdb-reporter.test.js
to write unit tests for theInfluxDBReporter
class.InfluxDBReporter
class fromsrc/influxdb-reporter.js
in the test file.InfluxDBReporter
class..github/workflows/main.yml
to run the unit tests using thenpm test
command.Please review the changes and merge this PR to include unit tests and the Github Actions step for running the tests in the CI/CD pipeline.
Fixes #35.
🎉 Latest improvements to Sweep:
💡 To get Sweep to edit this pull request, you can: