Skip to content

Commit

Permalink
Cover some missed branches.
Browse files Browse the repository at this point in the history
  • Loading branch information
autopulated committed Mar 5, 2024
1 parent e8f4a83 commit d7cb6cf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,11 @@ t.test('queries:', async t => {
t.equal(aFoo.constructor, (new Foo()).constructor, 'should have the correct constructor');
t.end();
});
t.test('queryOne noneexistent', async t => {
const noFoo = await Foo.queryOne({ type: 'doesnotexist' });
t.equal(noFoo, null, 'should return null');
t.end();
});
t.test('aborting queryOne', async t => {
const ac0 = new AbortController();
ac0.abort(new Error('my reason 0'));
Expand Down Expand Up @@ -550,6 +555,11 @@ t.test('queries:', async t => {
t.ok(all_foos.filter(x => x.id === aFooId).length === 1, 'should return a foo ID');
t.end();
});
t.test('queryOneId nonexistent', async t => {
const noFooId = await Foo.queryOneId({ type: 'nonexistent' });
t.equal(noFooId, null, 'should return null');
t.end();
});
await t.test('aborting queryOneId', async t => {
const ac1 = new AbortController();
// the AWS SDk doesn't propagate the abort reason (but it would be nice if it did in the future)
Expand Down

0 comments on commit d7cb6cf

Please sign in to comment.