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

add missing brackets and update incorrect values in tests #106

Merged
merged 1 commit into from
Dec 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/objects/invert.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ import test from 'tape';
import { objects } from '../../index.js';

test('objects.invert(object) - returns an object with key-value pairs inverted', t => {
const expect = { 4: 'horses', 19: 'your', 25: 'horses' };
const expect = { 4: 'horses', 19: 'your', 25: 'hold' };
const result = objects.invert({ hold: 25, your: 19, horses: 4 });

t.equal(Object.prototype.toString.call(result), '[object Object', 'return type');
t.equal(Object.prototype.toString.call(result), '[object Object]', 'return type');
t.deepEqual(result, expect, 'output value');

t.end();
});

test('objects.invert(object) - returns an object with key-value pairs inverted', t => {
const expect = { 0: 'lights', 1: 'camera', 2: 'action' };
const expect = { lights: '0', camera: '1', action: '2' };
const result = objects.invert(['lights', 'camera', 'action']);

t.equal(Object.prototype.toString.call(result), '[object Object', 'return type');
t.equal(Object.prototype.toString.call(result), '[object Object]', 'return type');
t.deepEqual(result, expect, 'output value');

t.end();
Expand All @@ -25,7 +25,7 @@ test('objects.invert(object) - returns an object inverted with duplicate values
const expect = { small: '9', big: '80' };
const result = objects.invert({ 80: 'big', 4: 'small', 9: 'small' });

t.equal(Object.prototype.toString.call(result), '[object Object', 'return type');
t.equal(Object.prototype.toString.call(result), '[object Object]', 'return type');
t.deepEqual(result, expect, 'output value');

t.end();
Expand All @@ -35,7 +35,7 @@ test('objects.invert(object) - returns an empty object if there are no items in
const expect = {};
const result = objects.invert({});

t.equal(Object.prototype.toString.call(result), '[object Object', 'return type');
t.equal(Object.prototype.toString.call(result), '[object Object]', 'return type');
t.deepEqual(result, expect, 'output value');

t.end();
Expand Down