-
Notifications
You must be signed in to change notification settings - Fork 52
MLE-25617 Two more client-level TS methods #1041
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -158,4 +158,47 @@ describe('DatabaseClient convenience methods runtime validation', function() { | |
| results[0].should.have.property('value'); | ||
| results[0].value.should.be.a.String(); | ||
| }); | ||
|
|
||
|
|
||
|
|
||
| it('should use setLogger with a level string', async function() { | ||
| // Set logger to 'info' level | ||
| client.setLogger('info'); | ||
|
|
||
| // Write a test document | ||
| await client.documents.write({ | ||
| uri: '/test-typescript/setlogger-test.json', | ||
| content: { test: 'setLogger' } | ||
| }).result(); | ||
|
|
||
| // Verify client is still functional after setting logger | ||
| const exists = await client.probe('/test-typescript/setlogger-test.json').result(); | ||
| exists.should.be.a.Boolean(); | ||
| exists.should.equal(true); | ||
| }); | ||
|
Comment on lines
164
to
178
|
||
|
|
||
| it('should use setLogger with a logger object', async function() { | ||
| // Create a simple logger object | ||
| const testLogger = { | ||
| debug: (msg: string) => console.log('DEBUG:', msg), | ||
| info: (msg: string) => console.log('INFO:', msg), | ||
| warn: (msg: string) => console.log('WARN:', msg), | ||
| error: (msg: string) => console.log('ERROR:', msg) | ||
| }; | ||
|
|
||
| // Set logger with object | ||
| client.setLogger(testLogger, false); | ||
|
|
||
| // Write a test document | ||
| await client.documents.write({ | ||
| uri: '/test-typescript/setlogger-test2.json', | ||
| content: { test: 'setLogger with object' } | ||
| }).result(); | ||
|
|
||
| // Verify client is still functional after setting logger | ||
| const exists = await client.probe('/test-typescript/setlogger-test2.json').result(); | ||
| exists.should.be.a.Boolean(); | ||
| exists.should.equal(true); | ||
| }); | ||
|
Comment on lines
180
to
202
|
||
|
|
||
| }); | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,44 @@ | ||||||
| /* | ||||||
| * Copyright (c) 2015-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved. | ||||||
| */ | ||||||
|
|
||||||
| /** | ||||||
| * Compile-time type checking tests for setLogger and setAuthToken. | ||||||
| * These tests verify TypeScript type definitions but don't execute. | ||||||
| */ | ||||||
|
|
||||||
| /// <reference path="../marklogic.d.ts" /> | ||||||
|
|
||||||
| import type { DatabaseClient } from 'marklogic'; | ||||||
|
|
||||||
| const marklogic = require('../lib/marklogic.js'); | ||||||
|
||||||
| const marklogic = require('../lib/marklogic.js'); | |
| import * as marklogic from '../lib/marklogic.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Remove excessive blank lines. There should be at most one blank line between test cases for consistency with the rest of the file.