Skip to content

throwMissingParameter test added#113

Open
vitordiricio wants to merge 1 commit intoufabc-next:masterfrom
vitordiricio:tests/pick-fields
Open

throwMissingParameter test added#113
vitordiricio wants to merge 1 commit intoufabc-next:masterfrom
vitordiricio:tests/pick-fields

Conversation

@vitordiricio
Copy link
Copy Markdown
Contributor

Feature | Change Request | Bug

Description

throwMissingParameter test added

const assert = require("assert")
const throwMissingParameter = require("./throwMissingParameter");

describe("helpers/validate/throwMissingParameter", () => {
Copy link
Copy Markdown
Member

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.

Suggested change
describe("helpers/validate/throwMissingParameter", () => {
describe('helpers/validate/throwMissingParameter', () => {

keytwo: "another value"
}

const fields = ["keyone", "keytwo"]
Copy link
Copy Markdown
Member

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: Expected indentation of 6 spaces but found 12.

Suggested change
const fields = ["keyone", "keytwo"]
const fields = ["keyone", "keytwo"]

const throwMissingParameter = require("./throwMissingParameter");

describe("helpers/validate/throwMissingParameter", () => {
describe("fields should match object keys", () => {
Copy link
Copy Markdown
Member

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: Expected indentation of 2 spaces but found 4.

Suggested change
describe("fields should match object keys", () => {
describe("fields should match object keys", () => {

const object = {
keyone: "value",
keytwo: "another value"
}
Copy link
Copy Markdown
Member

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: Expected indentation of 6 spaces but found 12.

Suggested change
}
}

@@ -0,0 +1,48 @@
const assert = require("assert")
Copy link
Copy Markdown
Member

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.

Suggested change
const assert = require("assert")
const assert = require('assert')

it("number of keys in object is greater than fields size", () => {
const object = {
keyone: "value",
keytwo: "another value",
Copy link
Copy Markdown
Member

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.

Suggested change
keytwo: "another value",
keytwo: 'another value',

describe("fields should match object keys", () => {
it("matching keys", () => {
const object = {
keyone: "value",
Copy link
Copy Markdown
Member

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.

Suggested change
keyone: "value",
keyone: 'value',

const throwMissingParameter = require("./throwMissingParameter");

describe("helpers/validate/throwMissingParameter", () => {
describe("fields should match object keys", () => {
Copy link
Copy Markdown
Member

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.

Suggested change
describe("fields should match object keys", () => {
describe('fields should match object keys', () => {

await assertFuncThrows("MissingParameter", throwMissingParameter, fields, object)
})
it("object and fields are empty", async () => {
const object = {}
Copy link
Copy Markdown
Member

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: Expected indentation of 6 spaces but found 12.

Suggested change
const object = {}
const object = {}


throwMissingParameter(fields, object)
})
it("number of keys in object is greater than fields size", () => {
Copy link
Copy Markdown
Member

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.

Suggested change
it("number of keys in object is greater than fields size", () => {
it('number of keys in object is greater than fields size', () => {

keytwo: "another value"
}

const fields = ["keyone", "randomkey"]
Copy link
Copy Markdown
Member

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.

Suggested change
const fields = ["keyone", "randomkey"]
const fields = ['keyone', "randomkey"]

@@ -0,0 +1,48 @@
const assert = require("assert")
const throwMissingParameter = require("./throwMissingParameter");
Copy link
Copy Markdown
Member

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.

Suggested change
const throwMissingParameter = require("./throwMissingParameter");
const throwMissingParameter = require('./throwMissingParameter');

describe("helpers/validate/throwMissingParameter", () => {
describe("fields should match object keys", () => {
it("matching keys", () => {
const object = {
Copy link
Copy Markdown
Member

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: Expected indentation of 6 spaces but found 12.

Suggested change
const object = {
const object = {

keytwo: "another value"
}

const fields = ["keyone", "randomkey"]
Copy link
Copy Markdown
Member

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: Expected indentation of 6 spaces but found 12.

Suggested change
const fields = ["keyone", "randomkey"]
const fields = ["keyone", "randomkey"]


await assertFuncThrows("MissingParameter", throwMissingParameter, fields, object)
})
it("object and fields are empty", async () => {
Copy link
Copy Markdown
Member

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.

Suggested change
it("object and fields are empty", async () => {
it('object and fields are empty', async () => {

it("matching keys", () => {
const object = {
keyone: "value",
keytwo: "another value"
Copy link
Copy Markdown
Member

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.

Suggested change
keytwo: "another value"
keytwo: 'another value'

const fields = ["keyone", "randomkey"]


await assertFuncThrows("MissingParameter", throwMissingParameter, fields, object)
Copy link
Copy Markdown
Member

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: Expected indentation of 6 spaces but found 12.

Suggested change
await assertFuncThrows("MissingParameter", throwMissingParameter, fields, object)
await assertFuncThrows("MissingParameter", throwMissingParameter, fields, object)

it("matching keys", () => {
const object = {
keyone: "value",
keytwo: "another value"
Copy link
Copy Markdown
Member

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: Expected indentation of 8 spaces but found 16.

Suggested change
keytwo: "another value"
keytwo: "another value"


throwMissingParameter(fields, object)
})
it("number of keys in object is greater than fields size", () => {
Copy link
Copy Markdown
Member

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: Expected indentation of 4 spaces but found 8.

Suggested change
it("number of keys in object is greater than fields size", () => {
it("number of keys in object is greater than fields size", () => {


throwMissingParameter(fields, object)
})
it("doesn't matching keys", async () => {
Copy link
Copy Markdown
Member

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: Expected indentation of 4 spaces but found 8.

Suggested change
it("doesn't matching keys", async () => {
it("doesn't matching keys", async () => {

it("number of keys in object is greater than fields size", () => {
const object = {
keyone: "value",
keytwo: "another value",
Copy link
Copy Markdown
Member

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: Expected indentation of 8 spaces but found 16.

Suggested change
keytwo: "another value",
keytwo: "another value",

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