-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add unit tests for InfluxDBReporter class
- Loading branch information
1 parent
1929ff4
commit 06e004c
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
const InfluxDBReporter = require('../src/influxdb-reporter'); | ||
const HttpService = require('../src/http.service'); | ||
const UdpService = require('../src/udp.service'); | ||
|
||
jest.mock('../src/http.service'); | ||
jest.mock('../src/udp.service'); | ||
|
||
describe('InfluxDBReporter', () => { | ||
let reporter; | ||
|
||
beforeEach(() => { | ||
reporter = new InfluxDBReporter(); | ||
}); | ||
|
||
describe('start', () => { | ||
it('sets up the context correctly', () => { | ||
// Test setup and assertions here | ||
}); | ||
|
||
it('throws an error when required parameters are missing', () => { | ||
// Test setup and assertions here | ||
}); | ||
}); | ||
|
||
describe('beforeItem', () => { | ||
it('updates the context correctly', () => { | ||
// Test setup and assertions here | ||
}); | ||
}); | ||
|
||
describe('request', () => { | ||
it('updates the current item\'s data correctly', () => { | ||
// Test setup and assertions here | ||
}); | ||
}); | ||
|
||
describe('exception', () => { | ||
it('does not throw any errors when called', () => { | ||
// Test setup and assertions here | ||
}); | ||
}); | ||
|
||
describe('assertion', () => { | ||
it('updates the assertion count correctly', () => { | ||
// Test setup and assertions here | ||
}); | ||
|
||
it('handles failed and skipped assertions correctly', () => { | ||
// Test setup and assertions here | ||
}); | ||
}); | ||
|
||
describe('item', () => { | ||
it('sends data to the service correctly', () => { | ||
// Test setup and assertions here | ||
}); | ||
}); | ||
|
||
describe('done', () => { | ||
it('disconnects the service correctly', () => { | ||
// Test setup and assertions here | ||
}); | ||
}); | ||
}); |