Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreMaz committed Oct 4, 2019
1 parent ed13502 commit d7b213e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "moleculer-db-adapter-cosmos",
"version": "0.0.1",
"version": "0.0.2",
"description": "Azure CosmosDB SQL native adapter for Moleculer DB service.",
"main": "index.js",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class CosmosDbAdapter {
const readResponse = await this.container.item(_id).read();

if (readResponse.statusCode >= 400) {
throw new Error(`Resource with ${_id} not found`);
throw new Error(`Resource with id "${_id}" not found`);
}

return readResponse.resource;
Expand Down Expand Up @@ -295,12 +295,12 @@ class CosmosDbAdapter {
const readResponse = await this.container.item(_id).read();

if (readResponse.statusCode >= 400) {
throw new Error(`Resource with ${_id} not found`);
throw new Error(`Resource with id "${_id}" not found`);
}

const delResponse = await this.container.item(_id).delete();
if (delResponse.statusCode >= 400) {
throw new Error(`Resource with ${_id} not found`);
throw new Error(`Resource with id "${_id}" not found`);
}

return readResponse.resource;
Expand Down
4 changes: 2 additions & 2 deletions test/unit/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ describe("Test CosmosStoreAdapter", () => {
return adapter.findById(id).catch(err => {
// console.log(err);
expect(err).toBeInstanceOf(Error);
expect(err.message).toBe(`Resource with ${id} not found`);
expect(err.message).toBe(`Resource with id "${id}" not found`);
});
});

Expand All @@ -160,7 +160,7 @@ describe("Test CosmosStoreAdapter", () => {
const id = "wrong-id";
return adapter.removeById(id).catch(err => {
expect(err).toBeInstanceOf(Error);
expect(err.message).toBe(`Resource with ${id} not found`);
expect(err.message).toBe(`Resource with id "${id}" not found`);
});
});

Expand Down
6 changes: 3 additions & 3 deletions test/unit/integration.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe("Test With Moleculer DB", () => {
let cosmosMock;

const connection = {
endpoint: `https://localhost:3000`,
endpoint: `https://localhost:3001`,
key: "dummy key",
agent: https.Agent({ rejectUnauthorized: false })
};
Expand All @@ -34,8 +34,8 @@ describe("Test With Moleculer DB", () => {

beforeAll(() => {
return new Promise((resolve, reject) => {
cosmosMock = cosmosServer().listen(3000, () => {
console.log(`Cosmos DB server running at https://localhost:3000`);
cosmosMock = cosmosServer().listen(3001, () => {
console.log(`Cosmos DB server running at https://localhost:3001`);
resolve();
});
});
Expand Down

0 comments on commit d7b213e

Please sign in to comment.