-
Notifications
You must be signed in to change notification settings - Fork 10
throwMissingParameter test added #113
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,48 @@ | ||||||||||
| const assert = require("assert") | ||||||||||
| const throwMissingParameter = require("./throwMissingParameter"); | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Strings must use singlequote.
Suggested change
|
||||||||||
|
|
||||||||||
| describe("helpers/validate/throwMissingParameter", () => { | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Strings must use singlequote.
Suggested change
|
||||||||||
| describe("fields should match object keys", () => { | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Expected indentation of 2 spaces but found 4.
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Strings must use singlequote.
Suggested change
|
||||||||||
| it("matching keys", () => { | ||||||||||
| const object = { | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Expected indentation of 6 spaces but found 12.
Suggested change
|
||||||||||
| keyone: "value", | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Strings must use singlequote.
Suggested change
|
||||||||||
| keytwo: "another value" | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Strings must use singlequote.
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Expected indentation of 8 spaces but found 16.
Suggested change
|
||||||||||
| } | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Expected indentation of 6 spaces but found 12.
Suggested change
|
||||||||||
|
|
||||||||||
| const fields = ["keyone", "keytwo"] | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Expected indentation of 6 spaces but found 12.
Suggested change
|
||||||||||
|
|
||||||||||
| throwMissingParameter(fields, object) | ||||||||||
| }) | ||||||||||
| it("number of keys in object is greater than fields size", () => { | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Strings must use singlequote.
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Expected indentation of 4 spaces but found 8.
Suggested change
|
||||||||||
| const object = { | ||||||||||
| keyone: "value", | ||||||||||
| keytwo: "another value", | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Strings must use singlequote.
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Expected indentation of 8 spaces but found 16.
Suggested change
|
||||||||||
| keythree: "different value" | ||||||||||
| } | ||||||||||
|
|
||||||||||
| const fields = ["keyone", "keytwo"] | ||||||||||
|
|
||||||||||
| throwMissingParameter(fields, object) | ||||||||||
| }) | ||||||||||
| it("doesn't matching keys", async () => { | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Expected indentation of 4 spaces but found 8.
Suggested change
|
||||||||||
| const object = { | ||||||||||
| keyone: "value", | ||||||||||
| keytwo: "another value" | ||||||||||
| } | ||||||||||
|
|
||||||||||
| const fields = ["keyone", "randomkey"] | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Strings must use singlequote.
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Expected indentation of 6 spaces but found 12.
Suggested change
|
||||||||||
|
|
||||||||||
|
|
||||||||||
| await assertFuncThrows("MissingParameter", throwMissingParameter, fields, object) | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Expected indentation of 6 spaces but found 12.
Suggested change
|
||||||||||
| }) | ||||||||||
| it("object and fields are empty", async () => { | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Strings must use singlequote.
Suggested change
|
||||||||||
| const object = {} | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Expected indentation of 6 spaces but found 12.
Suggested change
|
||||||||||
|
|
||||||||||
|
|
||||||||||
| const fields = [] | ||||||||||
|
|
||||||||||
|
|
||||||||||
| throwMissingParameter(fields, object) | ||||||||||
| }) | ||||||||||
| }) | ||||||||||
| }) | ||||||||||
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.
Codacy has a fix for the issue: Strings must use singlequote.