Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DX | Release | 10-03-2025 #35

Merged
merged 13 commits into from
Mar 11, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor error messages in deletion, publishing, and unpublishing tes…
…ts for clarity
harshithad0703 committed Feb 13, 2025
commit 8b9303fce9a5aab9eae619f2322397edc671f286
4 changes: 2 additions & 2 deletions test/deletion.ts
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ describe('delete', () => {

return connect(config).then((mongodb) => {
mongo = mongodb
mongoClient = new Mongodb(mongodb, connector, config.contentStore)
mongoClient = new Mongodb(mongodb, connector, config.contentStore, config)
db = mongoClient
})
.catch(console.error)
@@ -154,7 +154,7 @@ describe('delete', () => {
test('delete entry with error', () => {

return db.delete().catch((error) => {
expect(error.message).toEqual("Cannot read property '_content_type_uid' of undefined")
expect(error.message).toEqual("Cannot read properties of undefined (reading \'_content_type_uid\')")
})
})
})
4 changes: 2 additions & 2 deletions test/publishing.ts
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ describe('publish', () => {

return connect(config).then((mongodb) => {
mongo = mongodb
mongoClient = new Mongodb(mongodb, connector, config.contentStore)
mongoClient = new Mongodb(mongodb, connector, config.contentStore, config)
db = mongoClient
})
.catch(console.error)
@@ -64,7 +64,7 @@ describe('publish', () => {
describe('publish should throw an error', () => {
test('publish entry successfully', () => {
return db.publish().catch((error) => {
expect(error.message).toEqual('Cannot read property \'_content_type_uid\' of undefined')
expect(error.message).toContain('Cannot read properties of undefined (reading \'_content_type_uid\')')
})
})
})
4 changes: 2 additions & 2 deletions test/unpublishing.ts
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ describe('unpublish', () => {

return connect(config).then((mongodb) => {
mongo = mongodb
mongoClient = new Mongodb(mongodb, connector, config.contentStore)
mongoClient = new Mongodb(mongodb, connector, config.contentStore, config)
db = mongoClient
}).catch(console.error)
})
@@ -95,7 +95,7 @@ describe('unpublish', () => {
return db.unpublish().then((result) => {
expect(result).toBeUndefined()
}).catch((error) => {
expect(error.message).toEqual("Cannot read property '_content_type_uid' of undefined")
expect(error.message).toEqual("Cannot read properties of undefined (reading \'_content_type_uid\')")
})
})
})