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

spec: convert desktop capturer to expect #13269

Merged
merged 2 commits into from Jun 19, 2018

Conversation

Projects
None yet
3 participants
@codebytere
Copy link
Member

codebytere commented Jun 17, 2018

Ongoing work to migrate our specs from assert to chai's expect for better error messages.

This PR updates the desktop-capturer spec.

@codebytere codebytere requested a review from as a code owner Jun 17, 2018

assert.equal(error, null)
assert.notEqual(sources.length, 0)
expect(error).to.be.null()
expect(sources.length).to.not.equal(0)

This comment has been minimized.

@alexeykuzmin

alexeykuzmin Jun 18, 2018

Contributor

expect(sources).to.be.an('array').that.is.not.empty()?

assert.equal(error, null)
assert.notEqual(sources.length, 0)
expect(error).to.be.null()
expect(sources.length).to.not.equal(0)

This comment has been minimized.

@alexeykuzmin

alexeykuzmin Jun 18, 2018

Contributor

expect(sources).to.be.an('array').that.is.not.empty()?

expect(error).to.be.null()
expect(sources.length).to.not.equal(0)
sources.forEach((source) => {
expect(source.display_id.length).to.equal(0)

This comment has been minimized.

@alexeykuzmin

alexeykuzmin Jun 18, 2018

Contributor

Is display_id a string here? If yes, then wouldn't it be better to write something like this:

for (const {display_id: displayId} of sources) {
  expect(displayId).to.be.a('string').and.be.empty()
}
assert.notEqual(sources.length, 0)
sources.forEach((source) => { assert.equal(source.display_id.length, 0) })
expect(error).to.be.null()
expect(sources.length).to.not.equal(0)

This comment has been minimized.

@alexeykuzmin

alexeykuzmin Jun 18, 2018

Contributor

expect(sources).to.be.an('array').that.is.not.empty()?

assert.equal(sources.length, displays.length)
expect(error).to.be.null()
expect(sources.length).to.not.equal(0)
expect(sources.length).to.equal(displays.length)

This comment has been minimized.

@alexeykuzmin

alexeykuzmin Jun 18, 2018

Contributor

expect(sources).to.have.lengthOf(displays.length)?

@alexeykuzmin alexeykuzmin changed the title spec: convert desktop capturer to expect [wip] spec: convert desktop capturer to expect Jun 18, 2018

@alexeykuzmin alexeykuzmin changed the title [wip] spec: convert desktop capturer to expect spec: convert desktop capturer to expect Jun 19, 2018

@jkleinsc jkleinsc merged commit 0219ef0 into master Jun 19, 2018

11 checks passed

WIP ready for review
Details
ci/circleci: electron-linux-arm Your tests passed on CircleCI!
Details
ci/circleci: electron-linux-arm-test Your tests passed on CircleCI!
Details
ci/circleci: electron-linux-arm64 Your tests passed on CircleCI!
Details
ci/circleci: electron-linux-arm64-test Your tests passed on CircleCI!
Details
ci/circleci: electron-linux-ia32 Your tests passed on CircleCI!
Details
ci/circleci: electron-linux-x64 Your tests passed on CircleCI!
Details
ci/circleci: electron-mas-x64 Your tests passed on CircleCI!
Details
ci/circleci: electron-osx-x64 Your tests passed on CircleCI!
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@jkleinsc jkleinsc deleted the expect-desktop-capturer-spec branch Jun 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.