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

Write tests cleanup #167

Merged
merged 13 commits into from
Oct 12, 2017
Merged

Write tests cleanup #167

merged 13 commits into from
Oct 12, 2017

Conversation

yuit
Copy link
Contributor

@yuit yuit commented Oct 12, 2017

Part of #136. This PR is best reviewed by commit as each commit is equal to an update of the folder.

What happen in this PR are:

  • simplifying describe clause. We only have two layers of describe clauses - one for specifying the tested operation such as write, read etc. the other is a test scenario itself.

  • rename file to have better name

Some guidelines I try to stick with:

  • describe description is to describe scenario, majority are just type of payload or query.

  • without verb to describe an act, we assume tests are just doing write operation.

  • If tests do more than just write, use verb to specify such action in the describe description such as "updates" etc.

  • anything that is an entity in the system is referred as references as entity will be represent as reference off a root query

  • anything that is non-entity is referred as values

  • All setup should be in beforeAll clause; it clause should just do the test

@yuit yuit requested a review from nevir October 12, 2017 20:32
Copy link
Contributor

@nevir nevir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bowl

@@ -20,7 +20,7 @@ describe(`operations.write`, () => {
}
}`);

describe(`invalid write on a root, expect an object`, () => {
describe(`invalid nested values, expect an object`, () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"expect an object" is still a verb phrase - maybe "scalar in place of object value"?

@@ -23,7 +23,7 @@ describe(`operations.write`, () => {
}
}`);

describe(`write to inner nodes`, () => {
describe(`updates inner nodes`, () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"inner node updates"? maybe

@yuit yuit changed the title Simplify describe clause and rename file to better reflect write operation tests Write tests cleanup Oct 12, 2017
@yuit yuit merged commit b305ab8 into master Oct 12, 2017
@yuit yuit deleted the yuit/simplifyDescribeDescription branch October 12, 2017 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants