Skip to content

Commit

Permalink
fix: usage of let, 1 test -> 2 separate tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bmullan91 committed Oct 4, 2018
1 parent 921f934 commit edee6e4
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions test/querystring-implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ test('real life example', t => {
});

test('it should parse with space insensitivity', t => {
t.plan(5);
t.plan(4);

const source = {
meh: 'to be trimed',
Expand All @@ -318,15 +318,33 @@ test('it should parse with space insensitivity', t => {
}
};
const queries = ['{a}', '{ a}', '{a }', '{ a }'];
let expected = { a: 'a' };
const expected = { a: 'a' };

for (const query of queries) {
const actual = objectql(source, query);
t.deepEqual(actual, expected);
}
});

test('it should parse with space insensitivity in a deep object query', t => {
t.plan(1);

const source = {
meh: 'to be trimed',
a: 'a',
b: {
meh: 'to be trimed',
c: 'c',
d: {
meh: 'to be trimed',
e: 'e'
}
}
};

const query = '{a b{ c d { e }} }';
const actual = objectql(source, query);
expected = {
const expected = {
a: 'a',
b: {
c: 'c',
Expand Down

0 comments on commit edee6e4

Please sign in to comment.