Test files linted

This commit is contained in:
Angelos Chalaris
2018-08-03 10:39:26 +03:00
parent 5ef1fab5fd
commit cc7b76d0b3
153 changed files with 754 additions and 463 deletions

View File

@ -1,32 +1,32 @@
const expect = require("expect");
const dig = require("./dig.js");
const expect = require('expect');
const dig = require('./dig.js');
const data = {
level1: {
level2: {
level3: "some data",
level3: 'some data',
level3f: false,
level3a: [1, 2, 3, 4]
}
}
};
test("dig is a Function", () => {
test('dig is a Function', () => {
expect(dig).toBeInstanceOf(Function);
});
test("Dig target success", () => {
expect(dig(data, "level3")).toEqual("some data");
test('Dig target success', () => {
expect(dig(data, 'level3')).toEqual('some data');
});
test("Dig target with falsey value", () => {
expect(dig(data, "level3f")).toEqual(false);
test('Dig target with falsey value', () => {
expect(dig(data, 'level3f')).toEqual(false);
});
test("Dig target with array", () => {
expect(dig(data, "level3a")).toEqual([1,2,3,4]);
test('Dig target with array', () => {
expect(dig(data, 'level3a')).toEqual([1, 2, 3, 4]);
});
test("Unknown target return undefined", () => {
expect(dig(data, "level4")).toEqual(undefined);
test('Unknown target return undefined', () => {
expect(dig(data, 'level4')).toEqual(undefined);
});