Skip to content

Commit

Permalink
Simplify tests (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
Richienb committed Mar 4, 2021
1 parent b6181b3 commit 886ba13
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ test('get', t => {
t.is(dotProp.get({foo: 1}, 'foo'), 1);
t.is(dotProp.get({foo: null}, 'foo'), null);
t.is(dotProp.get({foo: undefined}, 'foo'), undefined);
t.is(dotProp.get({foo: {bar: true}}, 'foo.bar'), true);
t.is(dotProp.get({foo: {bar: {baz: true}}}, 'foo.bar.baz'), true);
t.true(dotProp.get({foo: {bar: true}}, 'foo.bar'));
t.true(dotProp.get({foo: {bar: {baz: true}}}, 'foo.bar.baz'));
t.is(dotProp.get({foo: {bar: {baz: null}}}, 'foo.bar.baz'), null);
t.is(dotProp.get({foo: {bar: 'a'}}, 'foo.fake'), undefined);
t.is(dotProp.get({foo: {bar: 'a'}}, 'foo.fake.fake2'), undefined);
t.is(dotProp.get({foo: {bar: 'a'}}, 'foo.fake.fake2', 'some value'), 'some value');
t.is(dotProp.get({foo: {}}, 'foo.fake', 'some value'), 'some value');
t.is(dotProp.get({'\\': true}, '\\'), true);
t.is(dotProp.get({'\\foo': true}, '\\foo'), true);
t.is(dotProp.get({'bar\\': true}, 'bar\\'), true);
t.is(dotProp.get({'foo\\bar': true}, 'foo\\bar'), true);
t.is(dotProp.get({'\\.foo': true}, '\\\\.foo'), true);
t.is(dotProp.get({'bar\\.': true}, 'bar\\\\.'), true);
t.is(dotProp.get({'foo\\.bar': true}, 'foo\\\\.bar'), true);
t.true(dotProp.get({'\\': true}, '\\'));
t.true(dotProp.get({'\\foo': true}, '\\foo'));
t.true(dotProp.get({'bar\\': true}, 'bar\\'));
t.true(dotProp.get({'foo\\bar': true}, 'foo\\bar'));
t.true(dotProp.get({'\\.foo': true}, '\\\\.foo'));
t.true(dotProp.get({'bar\\.': true}, 'bar\\\\.'));
t.true(dotProp.get({'foo\\.bar': true}, 'foo\\\\.bar'));
t.is(dotProp.get({foo: 1}, 'foo.bar'), undefined);

const fixture2 = {};
Expand Down

0 comments on commit 886ba13

Please sign in to comment.