feedback from review
This commit is contained in:
parent
2c2e8317de
commit
314071d79f
1 changed files with 7 additions and 8 deletions
|
@ -26,7 +26,7 @@ describe('desktopCapturer', () => {
|
||||||
types: ['window', 'screen']
|
types: ['window', 'screen']
|
||||||
}, (error, sources) => {
|
}, (error, sources) => {
|
||||||
expect(error).to.be.null()
|
expect(error).to.be.null()
|
||||||
expect(sources.length).to.not.equal(0)
|
expect(sources).to.be.an('array').that.is.not.empty()
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -43,7 +43,7 @@ describe('desktopCapturer', () => {
|
||||||
const callback = (error, sources) => {
|
const callback = (error, sources) => {
|
||||||
callCount++
|
callCount++
|
||||||
expect(error).to.be.null()
|
expect(error).to.be.null()
|
||||||
expect(sources.length).to.not.equal(0)
|
expect(sources).to.be.an('array').that.is.not.empty()
|
||||||
if (callCount === 2) done()
|
if (callCount === 2) done()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,10 +71,10 @@ describe('desktopCapturer', () => {
|
||||||
|
|
||||||
desktopCapturer.getSources({types: ['window']}, (error, sources) => {
|
desktopCapturer.getSources({types: ['window']}, (error, sources) => {
|
||||||
expect(error).to.be.null()
|
expect(error).to.be.null()
|
||||||
expect(sources.length).to.not.equal(0)
|
expect(sources).to.be.an('array').that.is.not.empty()
|
||||||
sources.forEach((source) => {
|
for (const {display_id: displayId} of sources) {
|
||||||
expect(source.display_id.length).to.equal(0)
|
expect(displayId).to.be.a('string').and.be.empty()
|
||||||
})
|
}
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -87,8 +87,7 @@ describe('desktopCapturer', () => {
|
||||||
const displays = screen.getAllDisplays()
|
const displays = screen.getAllDisplays()
|
||||||
desktopCapturer.getSources({types: ['screen']}, (error, sources) => {
|
desktopCapturer.getSources({types: ['screen']}, (error, sources) => {
|
||||||
expect(error).to.be.null()
|
expect(error).to.be.null()
|
||||||
expect(sources.length).to.not.equal(0)
|
expect(sources).to.be.an('array').of.length(displays.length)
|
||||||
expect(sources.length).to.equal(displays.length)
|
|
||||||
|
|
||||||
for (let i = 0; i < sources.length; i++) {
|
for (let i = 0; i < sources.length; i++) {
|
||||||
expect(sources[i].display_id).to.equal(displays[i].id.toString())
|
expect(sources[i].display_id).to.equal(displays[i].id.toString())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue