Skip to content

Commit

Permalink
Update to Readme.md. Correct call client.databases.create (#99)
Browse files Browse the repository at this point in the history
Fixes readme file to call `client.databases.create` instead of `client.database.create`. Also fixes test names that may be confusing.
  • Loading branch information
igorklopov authored and southpolesteve committed Aug 9, 2018
1 parent 4d9af8d commit 6d6f9a5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ const collectionDefinition = { id: "sample collection" };
const itemDefinition = { id: "hello world doc", content: "Hello World!" };

async function helloCosmos() {
const { database: db } = await client.database.create(databaseDefinition);
const { database: db } = await client.databases.create(databaseDefinition);
console.log('created db');

const { container } = await db.container.create(collectionDefinition);
const { container } = await db.containers.create(collectionDefinition);
console.log('created collection');

const { body } = await container.items.create(documentDefinition);
Expand Down
4 changes: 2 additions & 2 deletions src/test/functional/container.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,11 +426,11 @@ describe("NodeJS CRUD Tests", function() {
});
});

describe("container.createIfNotExists", function() {
describe("containers.createIfNotExists", function() {
let database: Database;
before(async function() {
// create database
database = await getTestDatabase("container.createIfNotExists");
database = await getTestDatabase("containers.createIfNotExists");
});

it("should handle container does not exist", async function() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/functional/database.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe("NodeJS CRUD Tests", function() {
await databaseCRUDTest();
});

describe("database.createIfNotExists", function() {
describe("databases.createIfNotExists", function() {
it("should handle does not exist", async function() {
const def: DatabaseDefinition = { id: addEntropy("does not exist") };
const { database } = await client.databases.createIfNotExists(def);
Expand Down

0 comments on commit 6d6f9a5

Please sign in to comment.