Skip to content

Commit

Permalink
test with different error versions
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-contreras-deel committed Apr 24, 2020
1 parent a0b9c62 commit 7d86ddc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,14 @@ describe('RedisPool', function () {
client = await redisPool.acquire(0)
const fakeCommand = promisify(client[NEW_COMMAND]).bind(client);

await fakeCommand('key').catch(async (error) => {
const response = await fakeCommand('key').catch(async (error) => {
assert.equal(error.name, 'ReplyError');
assert.equal(error.message, "ERR unknown command 'fakeCommand'");
assert.ok(error.message.startsWith("ERR unknown command"));
assert.ok(error.message.includes('fakeCommand'));
})

assert.ok(response === undefined)

await redisPool.release(0, client); // needed to exit tests
});

Expand Down

0 comments on commit 7d86ddc

Please sign in to comment.